Looking for the full interactive reference?

Open API Reference →

SDKs

No official SDK is shipped at v2.1. Generate a client from the OpenAPI 3.1 spec at /openapi.yaml using the open-source generator that fits your stack.

Recommended generators

  • TypeScript / JavaScript

    openapi-typescript + openapi-fetch

    Type-only client and a fetch wrapper that pins the path/method/return-type tuple at compile time.

  • Python

    openapi-python-client

    Generates a httpx-based async/sync client with typed models. Active maintenance.

  • Go

    oapi-codegen

    Codegen for net/http and chi. Generates server stubs too if you ever proxy the API.

Quickstart with openapi-typescript

Three steps: generate types from the spec, install the fetch wrapper, write your first typed call.

bash
# Generate a typed client from the OpenAPI spec
npx openapi-typescript public/openapi.yaml -o ./gen/api.ts

# Install the lightweight fetch wrapper
npm i openapi-fetch

Typed fetch call:

ts
import createClient from "openapi-fetch";
import type { paths } from "./gen/api";

const client = createClient<paths>({
  baseUrl: "https://api.gaflight.io",
  headers: {
    Authorization: `Bearer ${process.env.GAF_API_KEY}`,
    "X-Org-Id": process.env.GAF_ORG_ID!,
  },
});

const { data, error } = await client.GET("/api/v1/public/pilots", {});
if (error) throw error;
console.log(data);

Python and Go

Equivalent commands for the two other most common stacks. Both generators are mature open-source projects with active maintenance.

bash
# pip install openapi-python-client
openapi-python-client generate --path public/openapi.yaml

# Then in your code:
from your_generated_client import Client
client = Client(
    base_url="https://api.gaflight.io",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "X-Org-Id": ORG_ID,
    },
)
bash
# Generate Go bindings via oapi-codegen
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest
oapi-codegen -package gaflight openapi.yaml > gaflight/client.gen.go

cURL — the no-SDK path

The API is small and the auth model is simple: a bearer token and a single org header. cURL or fetch from any HTTP client works without any generated code.

bash
curl https://api.gaflight.io/api/v1/public/pilots \
  -H "Authorization: Bearer gaf_pk_<your-token>" \
  -H "X-Org-Id: <your-organization-uuid>"

SDKs on the roadmap

We will publish first-party Node and Python SDKs when the write API ships. v2.1 deliberately keeps the surface small so partners can read directly from the OpenAPI spec without waiting on us.

The OpenAPI spec lives at: /openapi.yaml