Connect a desktop agent
AICraft exposes three compatible surfaces, so the major desktop coding agents can point at the same key. This page lists the endpoint, base URL and tested model for each client.
Which surface does your client use?
| Client | API surface | Base URL |
|---|---|---|
| Codex Desktop / Codex++ | OpenAI Responses API | https://aicraftapi.net/v1 |
| Claude Code | Anthropic Messages API | https://aicraftapi.net |
| Cursor, Cline, Roo Code, Continue | OpenAI Chat Completions | https://aicraftapi.net/v1 |
Codex Desktop and Codex++
These clients speak the OpenAI Responses API at /v1/responses. In the provider settings, use:
Base URL: https://aicraftapi.net/v1 API key: sk-... (from the AICraft console) Model: openai/gpt-5.5 or openai/gpt-5.4-mini
For Codex CLI, the equivalent config.toml block is:
[model_providers.aicraft] name = "AICraft" base_url = "https://aicraftapi.net/v1" env_key = "AICRAFT_API_KEY" wire_api = "responses"
openai/gpt-5.2-codex and openai/gpt-5.3-codex currently return 502 because the provider channel is reporting “model resources busy”. Use openai/gpt-5.5 or openai/gpt-5.4-mini until the channel recovers.Claude Code
Claude Code speaks the Anthropic Messages API at /v1/messages. Set the environment variables before starting it:
export ANTHROPIC_BASE_URL=https://aicraftapi.net export ANTHROPIC_AUTH_TOKEN=sk-... export ANTHROPIC_MODEL=anthropic/claude-sonnet-5
Streaming and tool use are supported. If your Claude Code build sends a bare model name such as claude-opus-5-5, the gateway maps the common bare names to their anthropic/... IDs.
Cursor, Cline, Roo Code, Continue
Use the OpenAI-compatible provider with streaming enabled:
Base URL: https://aicraftapi.net/v1 API key: sk-... Model: openai/gpt-5.4-mini or deepseek/deepseek-v4.1-flash
Both models support tool calling. openai/gpt-5-nano does not support tools, so do not use it for agent workflows.
Tested on 1 December 2026
| Check | Result |
|---|---|
| Chat Completions, stream + tools | 200, tool_calls chunks present |
| Messages, stream + tools | 200, content_block_delta and tool_use |
| Responses, stream + tools | 200, function_call_arguments.delta |
| Unknown model on all three | 404 model_not_found |
Common errors
| Status | Meaning | What to do |
|---|---|---|
| 401 | Missing or invalid API key | Check the key and the Authorization: Bearer header. |
404 model_not_found | The model id is wrong or not in your group | Use an id from /models.html. |
| 429 | Balance or concurrency limit | Check the console balance and tier. |
| 502 | The model channel is temporarily busy at the provider | Retry, or switch to another model. |
Endpoints and model IDs are tested against the Hong Kong gateway. Model availability changes; check /status.html and /models.html for the current list.
If a client still fails, send the client name, the request id from the response headers, and the exact model id to support.int@aicraftapi.net.