SDK & Code Gen

SDK packages and OpenAPI client code generation

OpenAPI Client Generation

Generate a fully-typed client from the OpenAPI spec:

TypeScript (openapi-typescript-codegen)

bash
npx openapi-typescript-codegen \
  --input https://api.sysevo.io/api/v1/openapi.json \
  --output ./src/sysevo-client \
  --name SysevoClient

Python (openapi-python-client)

bash
pip install openapi-python-client
openapi-python-client generate \
  --url https://api.sysevo.io/api/v1/openapi.json

Go (oapi-codegen)

bash
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest
oapi-codegen -package sysevo https://api.sysevo.io/api/v1/openapi.json > sysevo.gen.go

Environment Variable Pattern

bash
# .env
SYSEVO_API_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxxxx
SYSEVO_BASE_URL=https://api.sysevo.io/api/v1
typescript
// sysevo.ts
const BASE = process.env.SYSEVO_BASE_URL!;
const KEY  = process.env.SYSEVO_API_KEY!;

export const sysevo = {
  get: (path: string) =>
    fetch(`${BASE}${path}`, { headers: { "X-API-Key": KEY } }).then(r => r.json()),
  post: (path: string, body: unknown) =>
    fetch(`${BASE}${path}`, {
      method: "POST",
      headers: { "X-API-Key": KEY, "Content-Type": "application/json" },
      body: JSON.stringify(body),
    }).then(r => r.json()),
};
Was this page helpful?
Open Dashboard →