ShiftAPI

Write Go.
TypeScript keeps up.

A Go framework that turns your handler types into an OpenAPI 3.1 spec at runtime and a typed TypeScript client on every save.

$npm create shiftapi@latest
or read the quickstart
main.goyou write this
type Greeting struct {
	  `json:"hello" `
	SentAt time.Time `json:"sent_at"`
}

func greet(
	r *http.Request, in *Person,
) (*Greeting, error) {
	// ...
}

api.Handle("POST /greet", greet)
api.d.tsregenerated on every save
export interface Greeting {
  hello: string;
  sent_at?: string;
}

const { data } = await client.POST(
  "/greet", { body },
);
data.hello
//   ^? string
  1. When you compile

    Registering a handler captures its input and output structs. Field tags say where each value is read from.

  2. When the server starts

    Those types become an OpenAPI 3.1 document served by the same process, so the spec cannot drift from the code.

  3. When you save

    The Vite or Next.js plugin fetches the spec and rewrites the client. Types update in your editor without a reload.

Validation tags, typed errors, file uploads, server-sent events, WebSockets, and a Scalar reference at /docs come along with it. The API is still an http.Handler, so your middleware and deployment stay the same. Read the docs for the rest.