API Reference
Drop-in replacement for the OpenAI API with three public model IDs. Change base_url and your key — everything else stays the same.
Quick Start
Get running in under 2 minutes:
Cursor / Windsurf
Base URL: https://gateway.fair-price.ai/v1 API Key: fp-sk-your_key_here Model: qwen3-235b
Cline
API Provider: OpenAI Compatible Base URL: https://gateway.fair-price.ai/v1 API Key: fp-sk-your_key_here Model ID: qwen3-235b Custom Headers: leave empty
Python
from openai import OpenAI
client = OpenAI(
base_url="https://gateway.fair-price.ai/v1",
api_key="fp-sk-your_key_here",
)
response = client.chat.completions.create(
model="qwen3-235b",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)Authentication
Pass your API key as a Bearer token in the Authorization header. Create keys in Dashboard → API Keys.
Authorization: Bearer fp-sk-your_key_here
Models
Use the public model ID in your request. qwen3-235b is the default route and automatically falls back to Kimi K2.6 and MiniMax M2.7 during provider overloads.
| Model ID | Description | Best for |
|---|---|---|
| qwen3-235b | Qwen3-235B-A22B, with Kimi and MiniMax fallback | Coding, reasoning, automatic failover |
| kimi-k2.6 | Kimi K2.6 | Long-context and agentic workflows |
| minimax-m2.7 | MiniMax M2.7 | Fast fallback and general chat |
Full model list via API: GET https://gateway.fair-price.ai/v1/models
Direct upstream IDs also work when your client prefers provider-native names: moonshotai/Kimi-K2.6 and MiniMaxAI/MiniMax-M2.7.
Chat Completions
/v1/chat/completionsIdentical to OpenAI Chat Completions. All standard parameters are supported.
Request body
{
"model": "qwen3-235b",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Explain async/await in Python." }
],
"temperature": 0.7, // optional, 0–2
"max_tokens": 2048, // optional
"stream": false // set true for streaming
}Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1748000000,
"model": "qwen3-235b",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 120,
"total_tokens": 162
}
}Streaming
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"delta":{"content":"Hello"},"index":0}]}
data: [DONE]Examples
curl
curl https://gateway.fair-price.ai/v1/chat/completions \
-H "Authorization: Bearer fp-sk-your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-235b",
"messages": [{"role": "user", "content": "Hello!"}]
}'Node.js / TypeScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://gateway.fair-price.ai/v1",
apiKey: "fp-sk-your_key_here",
});
const res = await client.chat.completions.create({
model: "qwen3-235b",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(res.choices[0].message.content);Streaming (Python)
from openai import OpenAI
client = OpenAI(
base_url="https://gateway.fair-price.ai/v1",
api_key="fp-sk-your_key_here",
)
with client.chat.completions.stream(
model="qwen3-235b",
messages=[{"role": "user", "content": "Write a quicksort in Python."}],
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)Aider
aider --openai-api-base https://gateway.fair-price.ai/v1 \
--openai-api-key fp-sk-your_key_here \
--model qwen3-235bErrors
Standard HTTP status codes. Error body follows OpenAI format.
| Status | Cause | Fix |
|---|---|---|
| 401 | Invalid or missing API key | Check Authorization header |
| 402 | Insufficient credit balance | Top up at fair-price.ai/dashboard/topup |
| 429 | Rate limit exceeded | Slow down requests or contact support |
| 500 | Upstream inference error | Retry with exponential backoff |
{
"error": {
"message": "Insufficient credit balance",
"type": "insufficient_quota",
"code": 402
}
}Pricing
Pre-purchase credits. No subscriptions. Credits are shared across all models.
Crypto payments receive +10% bonus credits. See all packages →