CertuAI model API: OpenAI and Anthropic compatible
About CertuAI: CertuAI is the AI that answers a small business's WhatsApp, Instagram and Messenger 24/7, with a built-in CRM, and is a Tech Provider on Meta's WhatsApp Business Platform. Paid plans start at US$ 99 a month, with no lock-in. Create my agent
One key for Claude, GPT, Gemini, DeepSeek, Qwen and more: OpenAI Chat Completions, OpenAI Responses and Anthropic Messages compatible, with fallbacks, streaming, per-key spending caps, and setups for Claude Code, Codex and OpenCode.
Summary in 7 facts
- One key for Claude, GPT, Gemini, DeepSeek, Qwen and more: OpenAI Chat Completions, OpenAI Responses and Anthropic Messages compatible, with fallbacks, streaming, per-key spending caps, and setups for Claude Code, Codex and OpenCode.
- Every model in the CertuAI chat (Claude, GPT, Gemini, DeepSeek, Qwen, Llama, Kimi, GLM, Mistral and more) behind one key and one balance.
- The API speaks the formats the tools already use: OpenAI Chat Completions, OpenAI Responses and Anthropic Messages.
- GET /api/v1/models is public (no key) and returns the OpenAI list format, plus context_length, input modalities, pricing in US dollars per token and credits_per_million_tokens.
- Use the id (for example deepseek/deepseek-v4-pro) as model. curl https://certuai.com/api/v1/models Requests are billed in credits from your account balance, for the tokens the model actually used, the same way the chat bills.
- Point the official SDK at CertuAI with base_url.
- You get Server-Sent Events: one data: {chunk} line per delta, and data: [DONE] at the end.
In numbers
| Number | What it means |
|---|---|
| US$ 19 | The dollar price in the list converts credits at the entry credit pack (US$ 19 for 60,000 credits). |
| 6 models | Send models: a list tried in order when a provider is down, overloaded or rate limited (up to 6 models in total). |
| US$ 99 a month | Paid plans start at US$ 99 a month, with no lock-in. |
Quickstart
Every model in the CertuAI chat (Claude, GPT, Gemini, DeepSeek, Qwen, Llama, Kimi, GLM, Mistral and more) behind one key and one balance. The API speaks the formats the tools already use: OpenAI Chat Completions, OpenAI Responses and Anthropic Messages.
- Sign in at https://certuai.com/all-ai and create a key in Settings, under Connect to Claude. It starts with
certu_sk_and is shown once. - Send a request:
curl https://certuai.com/api/v1/chat/completions \
-H "Authorization: Bearer $CERTUAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [{"role": "user", "content": "Write a haiku about latency."}]
}'
Base URL for OpenAI-compatible clients: https://certuai.com/api/v1. For Anthropic clients: https://certuai.com/api (they append /v1/messages).
Models and prices
GET /api/v1/models is public (no key) and returns the OpenAI list format, plus context_length, input modalities, pricing in US dollars per token and credits_per_million_tokens. Use the id (for example deepseek/deepseek-v4-pro) as model.
curl https://certuai.com/api/v1/models
Requests are billed in credits from your account balance, for the tokens the model actually used, the same way the chat bills. The dollar price in the list converts credits at the entry credit pack (US$ 19 for 60,000 credits). Every response says what it cost in usage.credits (and usage.cost in dollars). Models also accept their provider id (claude-sonnet-5, gpt-6-sol).
OpenAI SDK
Point the official SDK at CertuAI with base_url.
Python
from openai import OpenAI
client = OpenAI(base_url="https://certuai.com/api/v1", api_key="certu_sk_...")
r = client.chat.completions.create(
model="deepseek/deepseek-v4-pro",
messages=[{"role": "user", "content": "Explain CRDTs in two sentences."}],
)
print(r.choices[0].message.content)
print(r.usage) # prompt_tokens, completion_tokens, credits, cost
JavaScript / TypeScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://certuai.com/api/v1", apiKey: process.env.CERTUAI_API_KEY });
const r = await client.chat.completions.create({
model: "openai/gpt-6-sol",
messages: [{ role: "user", content: "Name three uses for a Bloom filter." }],
});
console.log(r.choices[0].message.content);
Supported: messages (text and image_url parts), max_tokens / max_completion_tokens, temperature, top_p, stop, tools and tool_choice (translated for Claude models), parallel_tool_calls, and response_format on OpenAI, Google and open models. The response carries the model that answered in model and its host in provider.
Streaming
Set "stream": true. You get Server-Sent Events: one data: {chunk} line per delta, and data: [DONE] at the end. The last chunk carries finish_reason and usage (with credits), always, with or without stream_options.
stream = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "Count to five."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
If you close the connection, generation stops and you pay only for what was produced.
Responses API
POST /api/v1/responses speaks the OpenAI Responses API, the format Codex and client.responses.create use. It works with every model in the list, not only GPT.
r = client.responses.create(
model="anthropic/claude-sonnet-5",
instructions="Answer in one line.",
input="What is a vector clock?",
)
print(r.output_text)
print(r.usage) # input_tokens, output_tokens, credits, cost
- OpenAI models get your request as sent, on OpenAI's own Responses API: reasoning items with
include: ["reasoning.encrypted_content"],custom(freeform) tools andlocal_shellwork as they do there. - Every other model gets
input(text, images,function_callandfunction_call_outputitems) andtoolstranslated, and answers with Responses items and events.customtools are offered to the model as a function with oneinputstring and come back ascustom_tool_call. Reasoning items from earlier turns are skipped. - Streaming sends the Responses events:
response.created,response.output_item.added,response.output_text.delta,response.function_call_arguments.delta,response.output_item.doneandresponse.completedwithusage(andcredits). - Stateless. Nothing is stored:
storeis always false, andprevious_response_id,conversation,backgroundanditem_referencereturn 400. Send the whole conversation ininput, as Codex does. - Billed by tokens only. Hosted tools that OpenAI bills apart from tokens (web search, file search, code interpreter, image generation, remote MCP) and
service_tierare removed from the request. models(fallbacks) works here too.POST /api/v1/responses/input_tokensestimates the input tokens for free.
Fallbacks
Send models: a list tried in order when a provider is down, overloaded or rate limited (up to 6 models in total). The switch happens before the first byte, so a stream always comes from a single model. The response header X-Certu-Fallback-From and the model field tell you which one answered.
{
"model": "anthropic/claude-sonnet-5",
"models": ["openai/gpt-6-sol", "deepseek/deepseek-v4-pro"],
"messages": [{"role": "user", "content": "Summarize this ticket..."}]
}
A 400 from a provider (a request the model cannot take) is returned right away: another model would not fix it.
App attribution
Name your app with X-Title: My App, or send HTTP-Referer: https://myapp.example and its host is used. Usage is recorded per app and per key.
Claude Code
POST /api/v1/messages is Anthropic Messages-compatible, so Claude Code runs on CertuAI with three environment variables. Claude models get your request exactly as sent (extended thinking, prompt caching and betas included).
export ANTHROPIC_BASE_URL=https://certuai.com/api
export ANTHROPIC_AUTH_TOKEN=certu_sk_...
export ANTHROPIC_MODEL=anthropic/claude-sonnet-5
export ANTHROPIC_SMALL_FAST_MODEL=anthropic/claude-haiku-4-5
claude
Claude Code calls https://certuai.com/api/v1/messages and /v1/messages/count_tokens, and the key works in Authorization: Bearer (ANTHROPIC_AUTH_TOKEN) or x-api-key (ANTHROPIC_API_KEY). Default Claude model names it sends (a Haiku or Sonnet with a date) are mapped to the closest Claude in the list.
Any other model in Claude Code. Set ANTHROPIC_MODEL=deepseek/deepseek-v4-pro (or qwen/qwen3-8-max, openai/gpt-6-sol). Text, images and tool calls are translated to and from the model; extended thinking and Anthropic server tools (web search, code execution) are Claude-only.
OpenAI Codex CLI
Add CertuAI as a provider in ~/.codex/config.toml:
model = "openai/gpt-6-sol"
model_provider = "certuai"
[model_providers.certuai]
name = "CertuAI"
base_url = "https://certuai.com/api/v1"
env_key = "CERTUAI_API_KEY"
wire_api = "responses"
export CERTUAI_API_KEY=certu_sk_...
codex
Codex calls https://certuai.com/api/v1/responses (the Responses API, see above). With a GPT model the request goes to OpenAI as sent, reasoning included; with any other model (anthropic/claude-sonnet-5, deepseek/deepseek-v4-pro) its shell, patch and MCP tools are translated. Swap model for any id from the list.
OpenCode
In opencode.json (project) or ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"certuai": {
"npm": "@ai-sdk/openai-compatible",
"name": "CertuAI",
"options": {
"baseURL": "https://certuai.com/api/v1",
"apiKey": "{env:CERTUAI_API_KEY}"
},
"models": {
"anthropic/claude-sonnet-5": { "name": "Claude Sonnet 5" },
"deepseek/deepseek-v4-pro": { "name": "DeepSeek V4 Pro" },
"openai/gpt-6-sol": { "name": "GPT-6 Sol" }
}
}
},
"model": "certuai/anthropic/claude-sonnet-5"
}
MCP tools
The CertuAI MCP server at https://certuai.com/api/v1/mcp has two tools for the models: listar_modelos (list the models and prices, free) and perguntar_modelo (ask any model, billed like the API). Claude, or any MCP client, can get a second opinion from another model mid-task. Test keys simulate perguntar_modelo and spend nothing.
claude mcp add --transport http certuai https://certuai.com/api/v1/mcp --header "Authorization: Bearer certu_sk_..."
Keys, limits and spending caps
- Scope. Calling a model needs
ia:escrever; listing and counting tokens needia:ler. Full-access keys (*) have both; read-only keys (*:ler) cannot spend credits. - Monthly cap per key. Set a credit limit on each key in Settings (or
PATCH /api/v1/keys/{id}with{"limiteMensalCreditos": 50000}while signed in). Once a key reaches it, requests get 402key_limituntil the next month (UTC). Answers shrink to fit what is left before they are refused. - Balance.
GET /api/v1/keyreturns the account balance, the key cap, what the key spent this month and its rate limit. - Rate limit. 60 requests per minute per key by default, shared with the rest of the API, announced in the
RateLimitheaders. - Test keys (
certu_sk_test_) cannot call models.
curl https://certuai.com/api/v1/key -H "Authorization: Bearer $CERTUAI_API_KEY"
Errors
Errors use the format of the endpoint: {"error": {"message", "type", "code", "param"}} on Chat Completions and Responses, and {"type": "error", "error": {"type", "message"}} on Messages.
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_request, provider_rejected | The request is invalid, or the model rejected it. |
| 401 | invalid_api_key | Missing, invalid or revoked key. |
| 402 | insufficient_credits, key_limit, budget | Not enough credits, the key monthly cap, or the account budget. |
| 403 | insufficient_scope, test_key | The key cannot call models. |
| 404 | model_not_found, not_stored | Unknown model id, or a stored response was asked for (none are stored). |
| 422 | content_policy | Refused by the content policy. |
| 429 | rate_limited | Too many requests; see Retry-After. |
| 502 / 503 | provider_error, model_unavailable | No model in the queue answered. Add fallbacks. |
The full schema is in /openapi.json (tag ai-models).
Updated 2026-10-15
In short
One key for Claude, GPT, Gemini, DeepSeek, Qwen and more: OpenAI Chat Completions, OpenAI Responses and Anthropic Messages compatible, with fallbacks, streaming, per-key spending caps, and setups for Claude Code, Codex and OpenCode.
About CertuAI: CertuAI is the AI that answers a small business's WhatsApp, Instagram and Messenger 24/7, with a built-in CRM, and is a Tech Provider on Meta's WhatsApp Business Platform. Paid plans start at US$ 99 a month, with no lock-in. Create my agent