Skip to main content

API Reference

Drawbridge accepts requests in multiple formats. Use whichever API format your SDK speaks — OpenAI Chat Completions, Anthropic Messages, or OpenAI Responses. Looking to wire up an editor? See the IDE integration guide.

Supported Formats

Choose the format that matches your SDK — all route to the same Claude models on the same key. The OpenAI-compatible formats and the Anthropic Messages API (what Claude Code uses) all return native tool-use. See pricing for the flat per-token rate.

SDK / ClientEndpointAuthBase URLStatus
OpenAI Python/TS SDKPOST /v1/chat/completionsAuthorization: Bearerhttps://api.drawbridge-tech.com/v1Live
Anthropic Python/TS SDKPOST /v1/messagesx-api-key + anthropic-versionhttps://api.drawbridge-tech.comLive
OpenAI Responses APIPOST /v1/responsesAuthorization: Bearerhttps://api.drawbridge-tech.com/v1Live
curl / HTTP clientAny available endpointDepends on endpointSee aboveLive

Authentication

Authentication depends on which format you use:

  • Anthropic Messages API: x-api-key: <api-key> + anthropic-version: 2023-06-01
  • OpenAI formats: Authorization: Bearer <api-key>

Get a key from the signup page.

Endpoints

POST/v1/messages

Anthropic Messages API — create a message (streaming or non-streaming). Returns native tool-use, included on your key.

Request Body
{
  "model": "claude-sonnet-4-6",
  "max_tokens": 1024,
  "system": "You are a helpful assistant.",
  "messages": [
    {"role": "user", "content": "Hello!"}
  ],
  "stream": true
}
Response
{
  "id": "msg_abc123",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "Hello! How can I help you today?"
    }
  ],
  "model": "claude-sonnet-4-6",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 8
  }
}
POST/v1/chat/completions

OpenAI Chat Completions API — create a chat completion (streaming or non-streaming)

Request Body
{
  "model": "smart",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
  ],
  "stream": true,
  "temperature": 0.7
}
Response
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1716000000,
  "model": "smart",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  }
}
POST/v1/responses

OpenAI Responses API — create a response (streaming or non-streaming)

Request Body
{
  "model": "smart",
  "input": [
    {"role": "user", "content": "Hello!"}
  ],
  "instructions": "You are a helpful assistant.",
  "stream": true
}
Response
{
  "id": "resp_abc123",
  "object": "response",
  "created_at": 1716000000,
  "model": "smart",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Hello! How can I help you today?"
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 12,
    "output_tokens": 8,
    "total_tokens": 20
  }
}
GET/v1/models

List available models

Response
{
  "object": "list",
  "data": [
    {
      "id": "smart",
      "type": "model",
      "display_name": "smart",
      "created_at": "2024-01-01T00:00:00Z"
    }
  ]
}
GET/health

Health check endpoint (no auth required)

Response
{
  "status": "ok"
}

Streaming

All POST endpoints support streaming via Server-Sent Events. Set "stream": true in the request body. The SSE format matches whichever API format you use:

OpenAI Chat Completions SSE
data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"Hello"},"finish_reason":null}]}

data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"!"},"finish_reason":null}]}

data: {"id":"chatcmpl-abc","choices":[{"delta":{},"finish_reason":"stop"}]}

data: [DONE]
Anthropic Messages SSE
event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"!"}}

event: message_stop
data: {"type":"message_stop"}

Rate Limits & Concurrency

Each key has a concurrency limit. When too many requests are in flight at once, further requests return HTTP 429 with a Retry-After header (seconds) — back off and retry after that delay.

Response on a throttled request (HTTP 429):

Retry-After: 12

{"error":{"type":"rate_limit_error","message":"Too many pending requests, please retry later"}}