Base URL
https://api.purebridge.uk
Use the API domain for programmatic traffic. Manage accounts, keys, and billing in the console.
Developer access
OpenAI-compatible API reference for developers and power users. This page keeps endpoint, SDK, CLI, agent, and error-handling details.
API Key · For individual developers and lightweight projects.
If you only want direct chat, writing, or image generation, start with the user guide or open Chatbox. This page is for users who need API Key, Base URL, SDK, CLI, IDE agent, and automation setup.
Base URL
Use the API domain for programmatic traffic. Manage accounts, keys, and billing in the console.
Authentication
Create an API KEY in the console, then send it in the Authorization header.
Compatibility
Works with OpenAI SDK style base_url, bearer authentication, and JSON request/response payloads.
Quickstart
Create an account, generate an API KEY, then configure base_url in the OpenAI SDK.
Endpoints
PureBridge keeps the public contract small and predictable. These are the routes currently documented for user-facing integrations.
/v1/models
Returns enabled PureBridge model IDs that can be used in completion requests.
/v1/chat/completions
Streaming supported
Accepts an OpenAI-style chat payload; supports stream: true SSE responses and stream: false JSON responses.
/health
Returns a lightweight OK signal for deployment and probe checks.
Request sample
Chat completions support stream: true for interactive responses. Use stream: false when you want a simple header-verification request.
Signed-in users see model IDs available to their current API plan. Public docs use the MODEL_ID placeholder; use the exact values returned by GET /v1/models.
curl https://api.purebridge.uk/v1/chat/completions \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"messages": [
{
"role": "system",
"content": "You are a concise assistant."
},
{
"role": "user",
"content": "Say hello from PureBridge."
}
],
"stream": true
}'
Response sample
data: {"id":"chatcmpl_123","object":"chat.completion.chunk","model":"YOUR_MODEL_ID","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}]}
data: {"id":"chatcmpl_123","object":"chat.completion.chunk","model":"YOUR_MODEL_ID","choices":[{"index":0,"delta":{"content":"Hello from PureBridge."},"finish_reason":null}]}
data: {"id":"chatcmpl_123","object":"chat.completion.chunk","model":"YOUR_MODEL_ID","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]
Verifiable request
When the selected model routes to the official OpenAI upstream, PureBridge passes through the x-request-id returned by OpenAI. You can also send X-Client-Request-Id so your own trace id is available in upstream troubleshooting.
verify.sh
export PB_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx"
CLIENT_REQUEST_ID="pb-verify-$(date +%s)"
BODY='{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"ping"}],"stream":false}'
printf "%s" "$BODY" | shasum -a 256
curl -sS -D - -o /tmp/purebridge-verify.json https://api.purebridge.uk/v1/chat/completions \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Client-Request-Id: $CLIENT_REQUEST_ID" \
--data-binary "$BODY" \
| grep -Ei '^(x-request-id|openai-|x-ratelimit|date):'
Enabled model IDs
Signed-in users see model IDs available to their current API plan. Public docs use the MODEL_ID placeholder; use the exact values returned by GET /v1/models.
Public docs do not display the platform-wide model directory. Sign in to the API Key workspace to see your plan models, then call GET /v1/models with your key.
Models payload
{
"object": "list",
"data": []
}
Integration details
Platforms can use different protocols. The API Key workspace generates complete Codex, Claude Code, OpenCode, Gemini CLI, and curl files from the current plan; copy the text and replace local files manually.
API KEY usage
The API Key flow is: purchase or redeem a plan, create an API KEY, configure PureBridge as an OpenAI-compatible provider, then monitor requests, tokens, and cost from the usage page.
Agent tool setup
First check the models in the API Key workspace, then configure the client's actual protocol. OpenAI Responses, Chat Completions, Anthropic Messages, and Gemini use different endpoints, headers, and file formats.
Terminal coding agent
Best for repository edits, code explanation, refactors, tests, and longer coding automation.
CLI pair programming
Good for small Git-aware changes, focused tests, diff explanations, and pre-commit cleanup.
IDE assistant
Good for VS Code / JetBrains code chat, completions, local edits, and project rules.
VS Code agent
Good for local agents that read and write files, run shell commands, use browser tools, or execute multi-step tasks.
Automation and workflows
Good for note processing, message summaries, daily reports, personal bots, scheduled jobs, and low-code automation.
Config snippets
Public docs use placeholders. After signing in, the API Key workspace generates complete files for the current plan; copy them and replace local configuration manually. Client files are never changed automatically.
Useful for SDKs and CLI tools that read OpenAI-compatible settings from the shell.
export OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx"
export OPENAI_BASE_URL="https://api.purebridge.uk/v1"
export PUREBRIDGE_MODEL="YOUR_MODEL_ID"
Use the PureBridge base URL exactly like an OpenAI-compatible provider.
from openai import OpenAI
client = OpenAI(
api_key="sk-xxxxxxxxxxxxxxxxxxxxxxxx",
base_url="https://api.purebridge.uk/v1",
)
response = client.chat.completions.create(
model="YOUR_MODEL_ID",
messages=[{"role": "user", "content": "Say hello from PureBridge."}],
stream=True,
)
For tools that provide an OpenAI-compatible or custom OpenAI provider form.
Provider: OpenAI Compatible / Custom OpenAI
Base URL: https://api.purebridge.uk/v1
API Key: sk-xxxxxxxxxxxxxxxxxxxxxxxx
Model: YOUR_MODEL_ID
Streaming: On for interactive chat; off for header verification
Use a separate CODEX_HOME when you want PureBridge isolated from another Codex setup.
model_provider = "PureBridge"
model = "YOUR_MODEL_ID"
[model_providers.PureBridge]
name = "PureBridge"
base_url = "https://api.purebridge.uk/v1"
wire_api = "responses"
requires_openai_auth = true
# auth.json
{"OPENAI_API_KEY":"sk-xxxxxxxxxxxxxxxxxxxxxxxx"}
For OpenAI-compatible chat-completions providers, opencode uses the AI SDK compatible provider shape.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"purebridge": {
"npm": "@ai-sdk/openai-compatible",
"name": "PureBridge",
"options": {
"baseURL": "https://api.purebridge.uk/v1",
"apiKey": "{env:OPENAI_API_KEY}"
},
"models": {
"YOUR_MODEL_ID": {
"name": "YOUR_MODEL_ID"
}
}
}
},
"model": "purebridge/YOUR_MODEL_ID"
}
Claude Code uses Anthropic Messages variables rather than OpenAI Chat Completions settings. Sign in to generate the full plan-scoped files.
export ANTHROPIC_BASE_URL="https://api.purebridge.uk"
export ANTHROPIC_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx"
export ANTHROPIC_MODEL="YOUR_MODEL_ID"
OpenCode can switch with /models only after the model is declared in its models object. Copy a new file manually when your plan changes.
Protocols: Responses / Chat Completions / Messages / Gemini
Config: generated from the current API plan in the workspace
Boundary: text only; client files are never changed automatically
Scenario focus
Next step
Register an account, create an API KEY in App Workspace, then call the API domain.
Notes