Developer Reference
Requests
Call any model with the official SDKs: chat, images, web search and JSON output.
Updated November 2026
Requests
Chabi speaks two APIs: OpenAI's Chat Completions at https://chabi.dev/v1/chat/completions for GPT models and every other vendor's models (ids like vendor/model), and Anthropic's Messages at https://chabi.dev/v1/messages for Claude models. Use the official SDKs. Each example comes two ways: SDK, where chabi is your signed-in @chabi/js client and supplies Chabi's address and the user's token, and Plain, with the user's token as the API key, for apps that sign in by hand.
GPT models: the OpenAI SDK
With @chabi/js
import OpenAI from "openai";const client = new OpenAI({...chabi.openai(),dangerouslyAllowBrowser: true, // the token only spends this user's credits in this app});const stream = await client.chat.completions.create({model: "gpt-6-luna", // you choose; Chabi never swaps itmessages,max_completion_tokens: 4096, // reasoning counts toward this tooreasoning_effort: "none",stream: true,});
Without the SDK: the user's token as the API key
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://chabi.dev/v1",apiKey: userToken,dangerouslyAllowBrowser: true, // the token only spends this user's credits in this app});const stream = await client.chat.completions.create({model: "gpt-6-luna", // you choose; Chabi never swaps itmessages,max_completion_tokens: 4096, // reasoning counts toward this tooreasoning_effort: "none",stream: true,});
Claude models: the Anthropic SDK
With @chabi/js
import Anthropic from "@anthropic-ai/sdk";const client = new Anthropic({...chabi.anthropic(),dangerouslyAllowBrowser: true,});const stream = client.messages.stream({model: "claude-sonnet-5-5",max_tokens: 4096, // thinking counts toward this toooutput_config: { effort: "low" },messages,});
Without the SDK: the user's token as the API key
import Anthropic from "@anthropic-ai/sdk";const client = new Anthropic({baseURL: "https://chabi.dev",apiKey: userToken,dangerouslyAllowBrowser: true,});const stream = client.messages.stream({model: "claude-sonnet-5-5",max_tokens: 4096, // thinking counts toward this toooutput_config: { effort: "low" },messages,});
Other makers' models: chabiAI
DeepSeek, Mistral, Llama, Qwen and every other maker's model (ids like vendor/model, all on the models page) speak OpenAI's API. chabiAI from @chabi/js/ai makes that client for you. It's the official OpenAI client underneath, so streaming, tools and types work as its docs say; it needs openai installed. Without the SDK, use the OpenAI SDK with the base URL and key, as for GPT.
With @chabi/js
import { chabiAI } from "@chabi/js/ai";const client = chabiAI(chabi);const reply = await client.chat.completions.create({model: "deepseek/deepseek-v4-flash",messages,max_tokens: 4096,});const image = await client.images.generate({model: "black-forest-labs/flux-3-image",prompt: "A brass key on a gold circle, flat illustration",}); // image.data[0].b64_json
Without the SDK: the user's token as the API key
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://chabi.dev/v1",apiKey: userToken,dangerouslyAllowBrowser: true,});const reply = await client.chat.completions.create({model: "deepseek/deepseek-v4-flash",messages,max_tokens: 4096,});const image = await client.images.generate({model: "black-forest-labs/flux-3-image",prompt: "A brass key on a gold circle, flat illustration",}); // image.data[0].b64_json
Any language: plain HTTP
curl https://chabi.dev/v1/chat/completions \-H "Authorization: Bearer $USER_TOKEN" \-H "Content-Type: application/json" \-d '{"model": "gpt-6-luna", "messages": [{"role": "user", "content": "Hi"}]}'
JSON output
Use each provider's structured outputs; Chabi passes them through. Still check the parsed result in your code.
// OpenAIresponse_format: {type: "json_schema",json_schema: { name: "quiz", schema, strict: true },},// Anthropic: format sits next to effortoutput_config: {effort: "low",format: { type: "json_schema", schema },},
- Everything else in the request goes to the provider as you sent it, so each provider's docs apply. Check MODEL NOTES for what each model accepts.
- Every model listed reasons before it answers, and that reasoning counts toward
max_tokens/max_completion_tokens. Leave room for it, or replies come back cut off or empty. - OpenAI:
max_tokensis accepted and sent on asmax_completion_tokens, which these models require. Onlyn: 1is supported. - Anthropic: custom tools and web search (
{ type: "web_search_20260209", name: "web_search" }) work.max_usesdefaults to 5 and can be at most 10. Anthropic's other hosted tools (web fetch, code execution…) andspeed,fallbacks,service_tier,inference_geo,mcp_servers,containerare refused for now (containeris allowed alongside web search). - OpenAI web search: use the Responses API,
client.responses.createon the same base URL (POST https://chabi.dev/v1/responses), withtools: [{ type: "web_search" }]. Function tools work there too.max_tool_callsdefaults to 5 and can be at most 10 with web search.background,previous_response_id,conversation,prompt,service_tierare refused andstoreis always off, so send the whole conversation ininputeach time. Web search isn't available onchat-latestor fine-tuned models. GET https://chabi.dev/v1/modelslists the models, each with amodality:chat,image,transcriptionorspeech.GET https://chabi.dev/v1/creditsreturns the signed-in user'sbalance_credits, andGET https://chabi.dev/v1/metheir displayname(ornull), so your app can show which Chabi account it's using. Apps never get the user's email.
Model notes
Every plan includes every model. You choose the model; Chabi never swaps it for another. See all models.
| Model | Endpoint | Credits per 1M tokens, input / output | Request notes |
|---|---|---|---|
gpt-6-astra | /v1/chat/completions | 1,500 / 7,500 | reasoning_effort low to max (not none). Tool calling needs OpenAI's Responses API, which Chabi doesn't serve yet. Requests over 272K input tokens cost 3,000 / 11,250. |
gpt-6.1-sol | /v1/chat/completions | 300 / 1,500 | reasoning_effort low, medium (default), high, xhigh or max; not none. Tool calling needs the Responses API. Requests over 272K input tokens cost 600 / 2,250. |
gpt-6.1-terra | /v1/chat/completions | 150 / 750 | reasoning_effort none to max (default medium); with none it takes temperature and top_p. Strong on images and technical drawings. Tool calling needs the Responses API. |
gpt-6-luna | /v1/chat/completions | 15 / 75 | reasoning_effort none to max (default medium). Function calling only with reasoning_effort none. Requests over 272K input tokens cost 30 / 112.5. |
gpt-5.6-sol | /v1/chat/completions | 750 / 4,500 | reasoning_effort none to max (default medium). Requests over 272K input tokens cost 1,500 / 6,750. |
chat-latest | /v1/chat/completions | 750 / 4,500 | OpenAI's current ChatGPT model. It changes when OpenAI updates it. |
claude-fable-5-1 | /v1/messages | 1,500 / 7,500 | Thinking is always on: leave out thinking, set depth with output_config.effort. Long turns on hard tasks. |
claude-opus-5-5 | /v1/messages | 600 / 3,000 | Thinking is always on; output_config.effort defaults to medium. tool_choice any or tool is refused. |
claude-sonnet-5-5 | /v1/messages | 300 / 1,500 | Thinking is on unless you send thinking: { type: "between_tools" } (effort high or below, no other thinking fields). Effort defaults to high. tool_choice any or tool is refused. |
claude-haiku-5-5 | /v1/messages | 15 / 75 | Thinking is on unless you send thinking: { type: "disabled" } (effort high or below). Effort defaults to medium. Requests over 100K input tokens cost 75 / 375. |
None of these models take temperature or top_p while reasoning. The simplest request works on every Claude model: leave out thinking and set output_config.effort. Only Sonnet and Haiku can turn thinking off, each in its own way (see the notes above); the others refuse thinking: { type: "disabled" }.
Models from 44 other makers (214 chat models, such as aion-labs/…, amazon/…, baidu/…, bytedance-seed/…, bytedance/…) and 59 image models are served through OpenRouter, billed by what each request actually cost. See them all with prices.
Speech to text is charged by the minute of audio instead (see SPEECH TO TEXT):
| Model | Endpoint | Credits per minute of audio |
|---|---|---|
gpt-transcribe | /v1/audio/transcriptions | 0.675 (about 40 an hour) |
gpt-realtime-2.1-mini | /v1/audio/speech | about 3.77 a minute of speech |
gpt-realtime-2.1 | /v1/audio/speech | about 13.14 a minute of speech |