API Documentation
Docs & Integrations
Last updated
faborapi is a low-cost, OpenAI-compatible AI API gateway: one sk-fabor- key and one prepaid balance give you 25 models from Anthropic Claude, Google Gemini, OpenAI GPT and xAI Grok. Pay $29 for $320 API credits (91% pack discount) — get effective token rates 86% to 98% lower than official provider pricing. Real cost = credit rate × 0.090625.
Base URL
https://faborapi.com/v1Get an API key →Authentication
Send your key in either header: Authorization: Bearer sk-fabor-… or x-api-key: sk-fabor-….
Keys are generated securely and shown masked in your account. The authenticated owner can copy a saved key; revoke it and create a replacement if it is compromised. Never commit a key to Git or expose it in browser code.
A revoked key is refused immediately with a 401 error.
Endpoints
POST /v1/chat/completions — chat completion, standard or streaming (OpenAI format). Requires a key.
POST /v1/messages — native Anthropic Messages and Claude Code. Requires a faborapi key and anthropic-version: 2023-06-01; choose a compatible enabled Claude model.
POST /v1/responses — OpenAI Responses on compatible enabled models. Send full input history; provider-hosted conversation references are not supported.
GET /v1/models — list of available models. No key required.
POST /v1/files, GET /v1/files, GET /v1/files/{id}, DELETE /v1/files/{id} — private file storage (max 20 MB per file). Requires a key.
Embeddings, generated images, video and audio endpoints are not available.
Capabilities & compatibility
faborapi forwards OpenAI-format request parameters unchanged to the model, so capability support depends on the model you call.
| Capability | How it works on faborapi |
|---|---|
| Chat Completions | POST /v1/chat/completions with the OpenAI request and response format, for every model in the catalog. |
| Anthropic Messages | POST /v1/messages forwards native Anthropic requests and responses. Use anthropic-version: 2023-06-01 and an enabled compatible Claude model; Claude Code uses base URL https://faborapi.com without /v1. |
| OpenAI Responses | POST /v1/responses forwards the OpenAI Responses format, on compatible models. Send full input history; store is false and provider-hosted previous_response_id/conversation references are not supported. |
| Streaming | "stream": true returns the selected endpoint's native server-sent events unchanged. Chat Completions requests enable stream_options.include_usage; token counts come from the provider's usage events. |
| Reasoning effort | Grouped Claude models (Opus 4.6, 4.7, 4.8, 5.5, Sonnet 5.5, Haiku 5.5) take a separate effort: reasoning_effort (Chat Completions), reasoning.effort (Responses), output_config.effort (Messages), the faborapi effort field, or a suffix such as claude-opus-4-8-high. Default medium; the exact variant is called, never a substitute. |
| Tool calling / function calling | tools and tool_choice are forwarded unchanged; support depends on the selected model and its upstream provider. |
| JSON output | response_format (json_object or json_schema) is forwarded unchanged; support depends on the selected model. |
| Vision and documents (multimodal input) | image_url and file content parts, or a file_id from POST /v1/files (max 20 MB), on models that accept images or documents. Output is text, code or JSON. |
| Model list | GET /v1/models returns the enabled model IDs; no key required. |
Not supported
- Assistants API, Realtime API and provider-hosted persistent conversation references: not available.
- Embeddings, image generation, video generation, audio transcription and text-to-speech endpoints: not available.
- Native Gemini generateContent and xAI-specific endpoints: not exposed; call every model through Chat Completions.
Reasoning effort
- Claude Opus 4.6, Opus 4.7, Opus 4.8, Opus 5.5, Sonnet 5.5 and Haiku 5.5 are each one model ID with a separate effort setting. The efforts offered by each model are listed in Models & prices and in GET /v1/models ("efforts" and "default_effort").
- Without an effort, these models use medium. An effort the model does not offer is refused with HTTP 400 and the list of valid values.
- When the model ID already ends with an effort suffix (claude-opus-4-8-high), the suffix wins and other effort fields are ignored.
- faborapi sends the exact variant ID (for example claude-opus-4-8-high) to the model provider and never substitutes another model or effort.
- Every effort of a model is billed at that model's listed rates. Higher efforts usually produce more reasoning tokens, which are billed as output tokens.
- Models without an effort setting (Claude Fable, GPT, Gemini, Grok) are called by their ID alone; the faborapi "effort" field is refused for them with HTTP 400, while OpenAI's reasoning_effort is forwarded unchanged.
| Endpoint | How to set the effort |
|---|---|
| POST /v1/chat/completions | "reasoning_effort": "high" (or the faborapi field "effort": "high") |
| POST /v1/responses | "reasoning": {"effort": "high"} (or "effort": "high") |
| POST /v1/messages | "output_config": {"effort": "high"} (or "effort": "high") |
| Any endpoint or tool | Effort suffix in the model ID, e.g. "claude-opus-4-8-high" |
Chat Completions
curl https://faborapi.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $FABOR_API_KEY" \
-d '{
"model": "claude-opus-4-8",
"reasoning_effort": "high",
"messages": [{"role": "user", "content": "Plan a database migration."}]
}'
# faborapi calls the exact variant claude-opus-4-8-highOpenAI SDK
from openai import OpenAI
client = OpenAI(api_key="sk-fabor-...", base_url="https://faborapi.com/v1")
resp = client.chat.completions.create(
model="claude-opus-4-8",
reasoning_effort="high", # low, medium, high, xhigh, max or thinking
messages=[{"role": "user", "content": "Plan a database migration."}],
)
# Same thing with the faborapi field: extra_body={"effort": "max"}Model-name form (editors, Claude Code)
# Tools that only accept a model name (Cursor, Continue, Roo Code, Claude Code):
claude-opus-4-8 → default effort (medium)
claude-opus-4-8-low → low
claude-opus-4-8-high → high
claude-opus-4-8-max → max
claude-opus-4-8-thinking → thinkingEffort not offered by the model → 400
{
"error": {
"message": "Effort 'xhigh' is not available for 'claude-opus-4-6'. Use one of: low, medium, high, max, thinking.",
"type": "invalid_request_error"
}
}Choosing a model
The model you want is named in the model field of the JSON body of each request — nothing else is needed:
POST https://faborapi.com/v1/chat/completions
Authorization: Bearer $FABOR_API_KEY
Content-Type: application/json
{
"model": "claude-sonnet-5-5",
"messages": [
{"role": "user", "content": "Hello!"}
]
}Use the exact model ID from the Models & prices list below — character for character. Each one has a copy button, so you never have to type it.
No provider or key group to pick. One faborapi key accesses every enabled, priced model. Use the exact model ID; for grouped Claude models, choose the effort separately (see Reasoning effort). The selected model and effort are never replaced with others.
Unknown or disabled name → 404. A typo like claud-sonnet-5-5, or a model that was disabled, is refused with:
{
"error": {
"message": "Model 'claud-sonnet-5-5' not found",
"type": "invalid_request_error"
}
}Same name everywhere. In Cursor, VS Code (Continue or Roo Code) or any other tool, the “model name / model ID” field takes exactly the same value as the model field here — see the Editor setup section.
One key gives access to every model in the catalog. You only pay for the model you actually call, at the price shown in the list.
Quickstart
curl https://faborapi.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $FABOR_API_KEY" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [{"role": "user", "content": "Hello!"}]
}'The response is the standard OpenAI chat.completion object, including a usage field with token counts.
Streaming
Add "stream": true to receive native server-sent events. Chat Completions enables stream_options.include_usage; Messages and Responses preserve their own event types and token usage.
curl https://faborapi.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $FABOR_API_KEY" \
-d '{
"model": "claude-sonnet-5-5",
"stream": true,
"messages": [{"role": "user", "content": "Hello!"}]
}'data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":""},"finish_reason":"stop"}]}
data: {"object":"chat.completion.chunk","choices":[],"usage":{"prompt_tokens":281,"completion_tokens":9,"prompt_tokens_details":{"cached_tokens":60,"cache_creation_tokens":3}}}
data: [DONE]Anthropic Messages
Use the Anthropic SDK with base URL https://faborapi.com and your faborapi key. The native request and response format, system content, tools and thinking settings are forwarded unchanged to a compatible model.
curl https://faborapi.com/v1/messages \
-H "Authorization: Bearer $FABOR_API_KEY" \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{"model":"claude-sonnet-5-5","max_tokens":1024,"output_config":{"effort":"high"},"messages":[{"role":"user","content":"Hello!"}]}'OpenAI Responses
Use the OpenAI SDK with https://faborapi.com/v1. Send input, the exact model ID and optional streaming parameters. Requests use store: false; send the complete input history rather than a provider-hosted conversation ID.
curl https://faborapi.com/v1/responses \
-H "Authorization: Bearer $FABOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","input":"Hello!","stream":false}'Files (PDF, images, documents)
There are two ways to send a file together with your message. Both produce the same result — pick whichever fits your workflow.
Option 1 — Inline (single call). Encode the file as base64 and put it directly in the message content. One request to POST /v1/chat/completions, no upload step. Best for one-off requests.
Option 2 — Upload once, reuse. Upload the file with POST /v1/files (multipart, max 20 MB, private to your account, free storage), then reference its id in any message. faborapi injects the file content before calling the model. Best when the same file is used across several requests.
Option 1: send the file inline
curl https://faborapi.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $FABOR_API_KEY" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Turn this document into a 10-question quiz."},
{"type": "file", "file": {"filename": "course.pdf", "file_data": "data:application/pdf;base64,JVBERi0x..."}}
]
}]
}'Option 2: upload once, then reference the file_id
curl https://faborapi.com/v1/files \
-H "Authorization: Bearer $FABOR_API_KEY" \
-F purpose="user_data" \
-F file="@course.pdf"
# → {"id": "file-8f3c...", "object": "file", "filename": "course.pdf", "bytes": 482113, ...}curl https://faborapi.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $FABOR_API_KEY" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [{
"role": "user",
"content": [
{"type": "file", "file": {"file_id": "file-8f3c..."}},
{"type": "text", "text": "Turn this document into a 10-question quiz."}
]
}]
}'List your files with GET /v1/files, delete with DELETE /v1/files/{id}. All three content shapes are accepted:
// Document (PDF, DOCX, TXT...) — inline base64
{"type": "file", "file": {"filename": "course.pdf", "file_data": "data:application/pdf;base64,JVBERi0x..."}}
// Image — inline base64
{"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0..."}}
// After an upload — reference the file_id (faborapi injects the content)
{"type": "file", "file": {"file_id": "file-8f3c..."}}The model must accept files. Recent GPT, Claude, Gemini and Grok models read PDFs and images; a text-only model returns an upstream error, which is not charged.
File contents count as input tokens for the model you call.
Models & prices
curl https://faborapi.com/v1/modelsAnthropic
| Model | Effort | Input | Output | Cache read | Cache write | Long requests |
|---|---|---|---|---|---|---|
Claude Fable 5claude-fable-5 | — | $2.00 | $10.00 | $0.200 | $2.50 | — |
Claude Fable 5.1claude-fable-5-1 | — | $10.00 | $50.00 | $1.00 | $12.50 | — |
Claude Haiku 5.5claude-haiku-5-5 | lowmediumhighxhighmaxthinking | $0.100 | $0.500 | $0.100 | $0.125 | — |
Claude Opus 4.6claude-opus-4-6 | lowmediumhighmaxthinking | $5.00 | $25.00 | $0.500 | $6.25 | — |
Claude Opus 4.7claude-opus-4-7 | lowmediumhighxhighthinking | $5.00 | $25.00 | $0.500 | $6.25 | — |
Claude Opus 4.8claude-opus-4-8 | lowmediumhighxhighmaxthinking | $5.00 | $25.00 | $0.500 | $6.25 | — |
Claude Opus 5.5claude-opus-5-5 | lowmediumhighxhighmaxthinking | $4.00 | $20.00 | $0.400 | $5.00 | — |
Claude Sonnet 5.5claude-sonnet-5-5 | lowmediumhighxhighmaxthinking | $2.00 | $10.00 | $0.200 | $2.50 | — |
Gemini
| Model | Effort | Input | Output | Cache read | Cache write | Long requests |
|---|---|---|---|---|---|---|
Gemini 3.1 Pro Previewgemini-3.1-pro-preview | — | $1.25 | $5.00 | $0.125 | $1.25 | — |
Gemini 3.5 Flashgemini-3.5-flash | — | $0.750 | $3.00 | $0.075 | $0.750 | — |
Gemini 3.7 Flashgemini-3.7-flash | — | $0.750 | $3.75 | $0.075 | $0.750 | — |
Gemini 3.8 Flashgemini-3.8-flash | — | $0.750 | $3.75 | $0.075 | $0.750 | — |
Gemini 3.8 Flash Cybergemini-3.8-flash-cyber | — | $0.750 | $3.75 | $0.075 | $0.750 | — |
OpenAI
| Model | Effort | Input | Output | Cache read | Cache write | Long requests |
|---|---|---|---|---|---|---|
GPT-5.6 Lunagpt-5.6-luna | — | $0.200 | $1.20 | $0.020 | $0.250 | $0.400 / $1.80 input/output above 272K; cache $0.040 / $0.500 |
GPT-5.6 Solgpt-5.6-sol | — | $5.00 | $30.00 | $0.500 | $6.25 | $10.00 / $45.00 input/output above 272K; cache $1.00 / $12.50 |
GPT-5.6 Terragpt-5.6-terra | — | $2.00 | $12.00 | $0.200 | $2.50 | $4.00 / $18.00 input/output above 272K; cache $0.400 / $5.00 |
GPT-6gpt-6 | — | $5.00 | $10.00 | $1.25 | $5.00 | — |
GPT-6 Astragpt-6-astra | — | $10.00 | $50.00 | $1.00 | $10.00 | — |
GPT-6 Lunagpt-6-luna | — | $0.100 | $0.500 | $0.010 | $0.100 | — |
GPT-6.1 Solgpt-6.1-sol | — | $2.00 | $10.00 | $0.100 | $2.00 | — |
Grok
| Model | Effort | Input | Output | Cache read | Cache write | Long requests |
|---|---|---|---|---|---|---|
Grok 3grok-3 | — | $2.00 | $6.00 | $0.500 | $2.00 | — |
Grok 3 Fast Betagrok-3-fast-beta | — | $2.00 | $6.00 | $0.500 | $2.00 | — |
Grok 3 Minigrok-3-mini | — | $2.00 | $6.00 | $0.500 | $2.00 | — |
Grok 4grok-4 | — | $2.00 | $6.00 | $0.500 | $2.00 | — |
Grok 4 Fastgrok-4-fast | — | $2.00 | $6.00 | $0.500 | $2.00 | — |
Prices in USD per 1M tokens, taken live from our catalog. Every effort of a model is billed at the same rates; the highlighted effort is the default.
Billing
Each successful request is charged from the token counts returned in usage, in four parts:
- Input — prompt tokens not served from cache.
- Output — completion tokens, including reasoning tokens of thinking models.
- Cache read —
cached_tokens. - Cache write —
cache_creation_tokens.
When prompt tokens exceed a long-request threshold, the request uses the listed long-context input, output and cache rates.
Token counts can be higher than your text alone: some models add hidden system tokens and reasoning tokens. These are counted as reported.
The cost is deducted after the response. A request is refused (402) when your balance is 0 or lower. Failed requests cost nothing.
Every request appears on the Usage page.
Compare credit pricing by provider: Claude, OpenAI, Gemini and Grok.
Credit packs
Credit packs range from the Nano Pack ($10 for $100 of credit, the minimum top-up) to the Gold Pack ($99 for $1100). Every pack credits the same USD balance and works with every model. Savings figures use the ×0.090625 factor shared by the Starter packs. Bronze and Gold lower it to 0.0891 and 0.09 respectively, so their real token cost is lower still.
| Pack | You pay | API credit added | Cost per $100 of credit | Real cost factor | Below credit face value |
|---|---|---|---|---|---|
| Nano PackMinimum top-up | $10 | $100 | $10.00 | × 0.1 | 90% |
| Mini Pack | $15 | $160 | $9.38 | × 0.0938 | 90.63% |
| Starter PackReference pack | $29 | $320 | $9.06 | × 0.0906 | 90.94% |
| Bronze Pack | $49 | $550 | $8.91 | × 0.0891 | 91.09% |
| Silver Pack | $89 | $960 | $9.27 | × 0.0927 | 90.73% |
| Gold Pack | $99 | $1100 | $9.00 | × 0.09 | 91% |
Errors
All errors use the same JSON shape:
{
"error": {
"message": "Insufficient balance. Please top up your faborapi account.",
"type": "insufficient_quota"
}
}Errors returned by faborapi
| HTTP | type | message | Meaning |
|---|---|---|---|
400 | invalid_request_error | Invalid JSON body · Missing 'model' | The request body is not valid JSON, or the model field is missing. |
400 | invalid_request_error | Effort '<effort>' is not available for '<id>'. Use one of: … | The requested effort is not offered by this model, or an effort was sent to a model without effort settings. |
401 | authentication_error | Invalid API key · Invalid or revoked API key | No key, a malformed key, an unknown key, or a revoked key. |
402 | insufficient_quota | Insufficient balance. Please top up your faborapi account. | Your balance is 0 or lower. Top up to continue. |
404 | invalid_request_error | Model '<id>' not found | The model does not exist in the catalog or is disabled. |
502 | server_error | Upstream unreachable | The model provider could not be reached. Retry later. |
503 | server_error | Model temporarily unavailable | The model exists but is not available right now. |
Errors passed through from the model provider
When the provider rejects a request, the API returns its HTTP status code with "type": "upstream_error". Failure messages are sanitized so internal provider/account details are not exposed.
Typical cases: 404 when a model is not currently served, 429 when the provider rate-limits, 400/502 when a parameter is rejected.
These requests are not charged. faborapi applies no rate limit of its own.
Limits & availability
Your faborapi packs and balance determine billing. Provider account groups and minimum recharges are not customer requirements. If you receive a temporary 429, retry with exponential backoff. If the AI service has no usable internal credential, requests return 503 without charging your balance. A provider-wide outage or a balance shared by all internal keys cannot be solved by switching keys.
Editor setup
- 1Open Cursor → Settings (⌘/Ctrl + ,) → Models.
- 2In “OpenAI API Key”, paste your sk-fabor-… key.
- 3Enable “Override OpenAI Base URL” and paste the Base URL https://faborapi.com/v1.
- 4Add the model name (e.g. claude-sonnet-5-5, or claude-sonnet-5-5-high to choose the effort) and enable it.
claude-sonnet-5-5Pick any model from the list, copy its exact name, and paste it into the editor's "Model name / Model ID" field.
Claude Code uses native Anthropic Messages; Cursor and Continue use the OpenAI-compatible address. Menu names may differ between versions.