此内容尚不支持你的语言。
OpenAPI to in seconds.
Production-grade API infrastructure. Typed SDKs, Zod schemas, TanStack Query hooks, and 20+ plugins. Free and open source.
2.7M downloads last week
export type Order = { id: string; symbol: string; side: 'buy' | 'sell'; type: 'market' | 'limit' | 'stop' | 'stop_limit'; quantity: number; price?: number; status: 'pending' | 'open' | 'filled' | 'partially_filled' | 'cancelled' | 'rejected'; createdAt: string;};
export type CreateOrderData = { body: Order;};
export type CreateOrderResponse = Order;import { z } from 'zod';
export const zOrder = z.object({ id: z.string().uuid(), symbol: z.string(), side: z.enum(['buy', 'sell']), type: z.enum(['market', 'limit', 'stop', 'stop_limit']), quantity: z.number(), price: z.number().optional(), status: z.enum(['pending', 'open', 'filled', 'partially_filled', 'cancelled', 'rejected']), createdAt: z.string().datetime(),});
export type Order = z.infer<typeof zOrder>;import * as v from 'valibot';
export const vOrder = v.object({ id: v.pipe(v.string(), v.uuid()), symbol: v.string(), side: v.picklist(['buy', 'sell']), type: v.picklist(['market', 'limit', 'stop', 'stop_limit']), quantity: v.number(), price: v.optional(v.number()), status: v.picklist(['pending', 'open', 'filled', 'partially_filled', 'cancelled', 'rejected']), createdAt: v.pipe(v.string(), v.isoTimestamp()),});
export type Order = v.InferOutput<typeof vOrder>;import { createOrder } from './sdk.gen';
const { data, error } = await createOrder({ symbol: 'AAPL', side: 'buy', type: 'limit', quantity: 10, price: 189.5,});
if (error) { console.error('Order failed:', error.message); return;}
console.log('Order placed:', data.id);import { useMutation } from '@tanstack/react-query';import { createOrderMutation } from './react-query.gen';
const { mutate, data, isPending } = useMutation({ ...createOrderMutation(),});
mutate({ body: { symbol: 'AAPL', side: 'buy', type: 'limit', quantity: 10, price: 189.5, },});from pydantic import BaseModel, AwareDatetimefrom typing import Literalfrom uuid import UUID
class Order(BaseModel): id: UUID symbol: str side: Literal['buy', 'sell'] type: Literal['market', 'limit', 'stop', 'stop_limit'] quantity: float price: float | None = None status: Literal['pending', 'open', 'filled', 'partially_filled', 'cancelled', 'rejected'] createdAt: AwareDatetimefrom client import Client, CreateOrderData
client = Client()
order, error = client.create_order(CreateOrderData( symbol='AAPL', side='buy', type='limit', quantity=10, price=189.50,))
if error: print(f'Order failed: {error.message}')else: print(f'Order placed: {order.id}')Up and running in minutes
One config file. One command. Every time your spec changes.
Define your API
Start with an existing spec or create one from scratch. OpenAPI is the foundation that powers everything.
openapi: 3.2.0info: title: Equity Trading API version: 1.2.0paths: /orders: post: operationId: createOrder requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Order' responses: '201': description: Order placed content: application/json: schema: $ref: '#/components/schemas/Order'Everything your API layer needs
Pick what you need. Everything works together.
SDKs & Types
Typed SDK clients that regenerate as your API evolves. No handwritten interfaces to maintain.
Get started →Plugin Ecosystem
From TanStack Query to Zod. Every plugin is opt-in, independently useful, and built to work together.
Explore plugins →HTTP Clients
Native support for your runtime. Fetch API, Axios, Angular, Next.js, Nuxt, and more.
Explore clients →Extensibility
Build custom plugins and clients with the same APIs powering the built-ins. A platform, not a black box.
Build a plugin →Honest take
Not the right fit if…
- Your spec is broken or out of date.
- You're building a one-off integration, not a long-term API contract.
- You already have a codegen workflow that works.
- You want zero build steps.
- We don't support your language yet.
If none of these apply, you'll probably love it.
The API tooling I always wanted.
I built API clients for years using every tool out there. They all felt like an afterthought – I was always sacrificing quality, workflow, cost, or speed.
Eventually, I decided to reject those trade-offs. But I didn't want to build yet another code generator. I wanted to create the last code generator. After years of work, I'm excited to finally share it with you.
Hey API is purpose-built from scratch to handle all kinds of APIs, yours included. It's fast, open source, and deeply customizable. The output is production-grade. Most importantly, it just works.
I can't wait to see what you build with it.
Python is next.
The ecosystem trusted by TypeScript developers is coming to Python codebases. Production-grade SDKs, Pydantic models, and more. Sign up for early access.
Sponsors
They make this possible. We make it worth sponsoring.