API Reference

OpenAI-compatible

Drop-in replacement for the OpenAI API with two active public model IDs. Change base_url and your key — everything else stays the same.

Quick Start

Get running in under 2 minutes:

Cursor / Windsurf

Settings → Models → OpenAI-compatible provider
Base URL:  https://gateway.fair-price.ai/v1
API Key:   fp-sk-your_key_here
Model:     minimax-m2.7

Cline

API Configuration → OpenAI Compatible
API Provider:   OpenAI Compatible
Base URL:       https://gateway.fair-price.ai/v1
API Key:        fp-sk-your_key_here
Model ID:       minimax-m2.7
Custom Headers: leave empty

Python

pip install openai
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="minimax-m2.7",
    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.

HTTP header
Authorization: Bearer fp-sk-your_key_here
Keep your API key secret. Never expose it in client-side code or public repos. Keys can be revoked from the dashboard at any time.

Models

Use the public model ID in your request. minimax-m2.7 is the recommended default. Each model route can fall back to the other active Gonka model during supported upstream outages.

Model IDDescriptionBest for
minimax-m2.7MiniMax M2.7 · 200K context · 8K max outputFast chat, coding, and tool use
deepseek-v4-flash-0731DeepSeek V4 Flash 0731 · 380K context · 32K max outputReasoning, coding, and agentic workflows

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: MiniMaxAI/MiniMax-M2.7 and deepseek-ai/DeepSeek-V4-Flash-0731. Existing clients using qwen3-235b or kimi-k2.6 are temporarily routed to MiniMax for compatibility, but should migrate to an active model ID.

Chat Completions

POST
/v1/chat/completions

Identical to OpenAI Chat Completions. All standard parameters are supported.

Request body

application/json
{
  "model": "minimax-m2.7",
  "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

200 OK
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1748000000,
  "model": "minimax-m2.7",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "..." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 120,
    "total_tokens": 162
  }
}

Streaming

stream: true — server-sent events
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"delta":{"content":"Hello"},"index":0}]}

data: [DONE]

Examples

curl

shell
curl https://gateway.fair-price.ai/v1/chat/completions \
  -H "Authorization: Bearer fp-sk-your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m2.7",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Node.js / TypeScript

npm install openai
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: "minimax-m2.7",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(res.choices[0].message.content);

Streaming (Python)

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="minimax-m2.7",
    messages=[{"role": "user", "content": "Write a quicksort in Python."}],
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)

Aider

shell
aider --openai-api-base https://gateway.fair-price.ai/v1 \
      --openai-api-key fp-sk-your_key_here \
      --model minimax-m2.7

Errors

Standard HTTP status codes. Error body follows OpenAI format.

StatusCauseFix
401Invalid or missing API keyCheck Authorization header
402Insufficient credit balanceTop up at fair-price.ai/dashboard/topup
429Rate limit exceededSlow down requests or contact support
500Upstream inference errorRetry with exponential backoff
Error response body
{
  "error": {
    "message": "Insufficient credit balance",
    "type": "insufficient_quota",
    "code": 402
  }
}

Pricing

Pre-purchase credits. No subscriptions. Credits are shared across all models.

Starter:$50.85B credits
Pro:$203.5B credits
Scale:$5010B credits

Crypto payments receive +10% bonus credits. See all packages →