CertuAI

CertuAI model API: OpenAI and Anthropic compatible

Written by

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

In numbers

NumberWhat it means
US$ 19The dollar price in the list converts credits at the entry credit pack (US$ 19 for 60,000 credits).
6 modelsSend models: a list tried in order when a provider is down, overloaded or rate limited (up to 6 models in total).
US$ 99 a monthPaid 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.

  1. 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.
  2. 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

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

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.

StatuscodeMeaning
400invalid_request, provider_rejectedThe request is invalid, or the model rejected it.
401invalid_api_keyMissing, invalid or revoked key.
402insufficient_credits, key_limit, budgetNot enough credits, the key monthly cap, or the account budget.
403insufficient_scope, test_keyThe key cannot call models.
404model_not_found, not_storedUnknown model id, or a stored response was asked for (none are stored).
422content_policyRefused by the content policy.
429rate_limitedToo many requests; see Retry-After.
502 / 503provider_error, model_unavailableNo 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