Docs OpenAPI

OpenAPI Specification

OpenAPI 3.1.0 — Generate clients in any language

Overview

The Swiftly AIKit Cloud API is described using the OpenAPI 3.1.0 specification. You can use this spec to generate client libraries in any language, import into API tools like Postman, or generate documentation.

Download

Download the OpenAPI specification:

curl -O https://api.getswiftly.ai/openapi.yaml

Specification Preview

openapi: "3.1.0"
info:
    title: Swiftly AIKit Cloud API
    version: "1.0.0"
    description: Multi-provider AI gateway API
servers:
    - url: https://api.getswiftly.ai
      description: Production server
security:
    - ApiKeyAuth: []
paths:
    /v1/ai/chat:
        post:
            summary: Chat completion
            operationId: chat
            security:
                - ApiKeyAuth: []
                  BundleIdAuth: []
    /v1/ai/stream:
        post:
            summary: SSE streaming chat
            operationId: streamChat
            security:
                - ApiKeyAuth: []
                  BundleIdAuth: []
    /v1/ai/images:
        post:
            summary: Image generation
            operationId: generateImage
    /v1/ai/tokens:
        post:
            summary: Token counting
            operationId: countTokens
    /v1/ai/models:
        get:
            summary: List available models
            operationId: getModels
    /health:
        get:
            summary: Health check
            operationId: healthCheck
            security: []
components:
    securitySchemes:
        ApiKeyAuth:
            type: apiKey
            in: header
            name: X-API-Key
        BundleIdAuth:
            type: apiKey
            in: header
            name: X-Bundle-ID

Generate Clients

Use the OpenAPI Generator CLI to generate clients in any language:

# Install OpenAPI Generator
npm install @openapitools/openapi-generator-cli -g

# Generate a Python client
openapi-generator-cli generate \
  -i openapi.yaml \
  -g python \
  -o ./swiftlyai-python-client

# Generate a TypeScript client
openapi-generator-cli generate \
  -i openapi.yaml \
  -g typescript-fetch \
  -o ./swiftlyai-ts-client

# Generate a Go client
openapi-generator-cli generate \
  -i openapi.yaml \
  -g go \
  -o ./swiftlyai-go-client