API Documentation & Technical Reference

SubPool provides a high-performance Universal AI Gateway fully compatible with OpenAI Chat Completions and Anthropic Messages protocols. Connect via official SDKs, cURL, or integrate seamlessly into your backend services.

Quickstart & Authentication

SubPool is a high-performance universal AI gateway. Use one API key to access 50+ leading models from OpenAI, Anthropic, Google Gemini, DeepSeek, and other providers through industry-standard APIs.

1 Core connection settings

Parameter Configuration value Applies to
Base URL (OpenAI) https://subpool.net/v1 OpenAI SDK, Cursor, Cline, OpenCode, Continue, Python & Node.js
Base URL (Anthropic) https://subpool.net Claude Code CLI, Claude Desktop App, @anthropic-ai/sdk
API Key sk-xxxxxxxxxxxxxxxx Create a key at Manage API keys All requests to the SubPool Gateway
Model ID claude-3-7-sonnet, gpt-4o, deepseek-chat... Find the exact model ID on the Pricing & Models Automatically routed by model ID

2 Request authentication headers

SubPool accepts both common authentication header formats. Choose the one supported by your tool or library:

OpenAI format (Authorization Bearer) HTTP Header
Authorization: Bearer sk-xxxxxxxxxxxxxxxx

For the OpenAI Python/Node SDKs, cURL, LangChain, LlamaIndex, and Cursor.

Anthropic format (x-api-key) HTTP Header
x-api-key: sk-xxxxxxxxxxxxxxxx
anthropic-version: 2023-06-01

For the Anthropic SDK, Claude Code CLI, and Claude Desktop.

3 Send your first connection test request

Run a simple cURL command in your terminal to verify the connection and API key:

bash / zsh cURL
curl https://subpool.net/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $SUBPOOL_API_KEY" \
  -d '{
    "model": "claude-3-7-sonnet",
    "messages": [
      {"role": "system", "content": "You are a helpful AI expert."},
      {"role": "user", "content": "Hello! Please confirm the connection to the SubPool Gateway."}
    ],
    "temperature": 0.7
  }'

Sample success response (HTTP 200 OK)

application/json
{
  "id": "chatcmpl-8zV3A4kL9Qx8p",
  "object": "chat.completion",
  "created": 1729061000,
  "model": "claude-3-7-sonnet",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Connection successful! The SubPool Gateway is ready to process your request."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 28,
    "completion_tokens": 18,
    "total_tokens": 46
  }
}

Integrating an IDE or AI coding agent?

We provide detailed setup guides for Claude Code CLI, Cursor, Cline, Continue, OpenCode, and Codex CLI, including OS-specific instructions and one-click setup scripts.

View tool setup guides