API Documentation & Integration Guide
High-performance LLM inference, OpenAI-compatible proxy, and Native Ollama APIs.
The gateway provides standard OpenAI-compatible (/v1) endpoints and Native Ollama (/api) endpoints with SHA-256 hashed Bearer token authentication, real-time chunked streaming, and hardware compute metering.
🔑 1. Authentication & API Key Pre-Fill
Select or generate an API key below to automatically populate your Bearer token in all code snippets on this page.
Authorization: Bearer pcw_live_secret_token_here⚡ 2. Zed IDE Configuration
In Zed, press Cmd + , or open ~/.config/zed/settings.json and paste either provider configuration below:
{
"language_models": {
"openai": {
"api_url": "https://api.proxyai.co.uk/v1",
"available_models": [
{
"name": "ornith-1.5:35b",
"display_name": "ornith-1.5:35b (Local GPU)",
"max_tokens": 32768
},
{
"name": "ornith-1.5:35b",
"display_name": "Ornith 1.5 35B (Local GPU)",
"max_tokens": 262144
}
]
}
}
} When Zed prompts for the OpenAI API Key in the UI, enter your token: pcw_live_secret_token_here
{
"language_models": {
"ollama": {
"api_url": "https://api.proxyai.co.uk?key=pcw_live_secret_token_here",
"available_models": [
{
"name": "ornith-1.5:35b",
"display_name": "ornith-1.5:35b (Local GPU)",
"max_tokens": 32768
},
{
"name": "ornith-1.5:35b",
"display_name": "Ornith 1.5 35B (Local GPU)",
"max_tokens": 262144
}
]
}
}
} Base URL is https://api.proxyai.co.uk. Model discovery probes /api/tags and /api/version.
🚀 3. OpenAI SDK Quickstart (/v1)
Point standard OpenAI client libraries to https://api.proxyai.co.uk/v1:
curl -X POST "https://api.proxyai.co.uk/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer pcw_live_secret_token_here" \
-d '{
"model": "ornith-1.5:35b",
"messages": [
{"role": "user", "content": "Explain quantum computing in 2 sentences."}
],
"stream": false
}'from openai import OpenAI
client = OpenAI(
base_url="https://api.proxyai.co.uk/v1",
api_key="pcw_live_secret_token_here"
)
response = client.chat.completions.create(
model="ornith-1.5:35b",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in 2 sentences."}
],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content or "", end="")import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.proxyai.co.uk/v1",
apiKey: "pcw_live_secret_token_here",
});
const stream = await client.chat.completions.create({
model: "ornith-1.5:35b",
messages: [{ role: "user", content: "Hello AI Gateway!" }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || "");
}🦙 4. Native Ollama API Endpoints
Native Ollama endpoints are served on https://api.proxyai.co.uk with NDJSON streaming:
curl -X POST "https://api.proxyai.co.uk/api/generate" \
-H "Authorization: Bearer pcw_live_secret_token_here" \
-H "Content-Type: application/json" \
-d '{
"model": "ornith-1.5:35b",
"prompt": "Why is the sky blue?",
"stream": false
}'⚡ 5. Energy (kWh) Billing Formulation
For self-hosted GPU Ollama profiles, your account balance is deducted based on the actual physical compute power consumed by your query: