OpenSDK

Quick Start

Generate your first TypeScript SDK in minutes.

This guide walks through the full flow: create a task from a URL, wait for it to build, then export the SDK.

Prerequisites

Step 1: Create a task

Submit a URL and optionally describe the data you need:

curl -X POST https://opensdk.ca/api/dispatch \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://docs.example.com/api",
    "task": "auth, list users, and delete users"
  }'

Response:

{
  "success": true,
  "data": {
    "taskId": "abc-123",
    "status": "queued",
    "inputType": "docs",
    "message": "Task created. Poll GET /api/dispatch/tasks/{taskId} for status."
  }
}

You can also import an OpenAPI spec directly instead of a URL:

curl -X POST https://opensdk.ca/api/dispatch \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "spec": { "openapi": "3.1.0", "info": { "title": "My API", "version": "1.0.0" }, "..." : "..." },
    "language": "typescript"
  }'

Step 2: Poll for completion

curl https://opensdk.ca/api/dispatch/tasks/abc-123 \
  -H "X-API-Key: YOUR_API_KEY"

Keep polling until status is "completed". The response includes the full task with analysis, spec, and SDK data:

{
  "success": true,
  "data": {
    "id": "abc-123",
    "status": "completed",
    "sourceUrl": "https://docs.example.com/api",
    "language": "typescript",
    "inputType": "docs",
    "analysis": {
      "pagesExamined": 42,
      "endpoints": ["..."],
      "schemas": ["..."]
    },
    "spec": { "..." : "..." },
    "sdk": { "..." : "..." }
  }
}

Other status values you may see while polling: queued, analyzing, building, generating, failed.

Step 3: Export the SDK

Once the task is complete, export the generated SDK:

curl https://opensdk.ca/api/dispatch/tasks/abc-123/export/sdk \
  -H "X-API-Key: YOUR_API_KEY"

Response:

{
  "success": true,
  "data": {
    "language": "typescript",
    "packageName": "@opensdk/example-api",
    "version": "1.0.0",
    "files": [
      { "path": "src/client.ts", "content": "..." },
      { "path": "src/models.ts", "content": "..." },
      { "path": "src/auth.ts", "content": "..." }
    ],
    "entryPoint": "src/index.ts",
    "dependencies": {}
  }
}

You can also export as OpenAPI 3.1 or raw spec:

curl https://opensdk.ca/api/dispatch/tasks/abc-123/export/openapi \
  -H "X-API-Key: YOUR_API_KEY"

Step 4: Use the SDK

The exported files form a standalone TypeScript package:

import { ExampleApiClient } from "./src";

const client = new ExampleApiClient({
  baseUrl: "https://api.example.com/v1",
  token: "your-bearer-token",
});

const users = await client.listUsers({ limit: 10 });

Step 5: Revise your SDK

Need changes? Describe what you want in plain English:

curl -X POST https://opensdk.ca/api/dispatch/tasks/abc-123/revise \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"revision": "add a search endpoint for filtering users by email"}'

Poll the task again to get the updated SDK.

Credit costs

OperationCreditsEndpoint
Dispatch (analyze or import)25POST /api/dispatch
Revise an existing task10POST /api/dispatch/tasks/:id/revise
Export SDK or spec5GET /api/dispatch/tasks/:id/export/:format

Every new account gets 100 free starter credits. Buy more anytime from the billing dashboard. Credits never expire.

What's next

On this page