Settings

Colors
Primary
Success
Warning
Danger
Info
Direction
RTL

Change text direction

To switch the text direction of your webpage from LTR to RTL, please consult the detailed instructions provided in the relevant section of our documentation.
Border width, px
Rounding, rem

To apply the provided styles to your webpage, enclose them within a <style> tag and insert this tag into the <head> section of your HTML document after the following link to the main stylesheet:
<link href="assets/css/theme.min.css">


            
Support Center
Profile
?? Profile
Security
Password
Two-Factor Authentication

Scan this QR code with your authenticator app:

2FA Enabled!

Save these recovery codes in a safe place:

CodeForge
Manage the API keys used by your CodeForge clients.
Loading keys…
Reveal shows the stored hash — a one-way fingerprint of the key your clients send. Rotate to issue a new key.
Active Sessions
Notifications
Communication channels
Confirm your email address to enable this channel.
Confirm your phone number to enable this channel.
Tools
Code Forge
Warn when another session is active on the same project.

Email alert when a limit window resets.
CodeForge Setup

Read the full setup details for OpenCode and other compatible clients.

Open full setup guide
Appearance
Theme
Light
Dark
System
Billing
Guest
Active
Loading...
Usage
Credits overage

Allow Chat and CodeForge to use your API-credit balance when enabled.

Credits
Daily

0

Dedicated

0

Need more credits?

Top up your dedicated balance anytime.

Buy Credits
Credits Total Subscription Balance
Integrations
Google Drive
Google Drive
Not Connected
Gmail
Gmail
Not Connected
Google Photos
Google Photos
Not Connected
Skip to documentation
Central Hub AI / Getting started

Developer documentation

Connect your application or coding harness to Central Hub AI using your endpoint, API key, and model ID.

Documentation reviewed on 10/8/2026

Quickstart

  1. Create an API key
  2. Choose a model
  3. Copy a request or configuration

Create a key, select an available model below, and copy the request for its recommended API. The same endpoint and credentials work with compatible SDKs and coding tools.

API base URL
https://codeforge-oaic.centralhubai.com/v1

This base URL includes /v1. Append the request path once, or pass the base URL to your OpenAI client.

Authentication

Open CodeForge Console → API Keys to create a named key and manage its lifecycle. Sign in to manage your own keys. Never share a key or commit it to source control.

Manage API keys
ActionValue
Create and nameGive each application a recognizable key name. Save the key when it is created.
Reveal and copyUse the copy/reveal controls and the remaining reveal allowance shown on the API Keys page. When copying is unavailable, rotate the key and save the replacement.
RotateRotation replaces the secret. Update every application using the previous value before making another request.
RevokeRevoke a key to stop its use. Requests using a revoked, expired, disabled, or deleted key fail authentication.
DeleteDelete a key through the existing management page when it is no longer needed.

Set your key in an environment variable

Replace YOUR_API_KEY locally. These documentation examples contain placeholders only; this page never creates or reveals a key.

PowerShell
$env:CODEFORGE_API_KEY = "YOUR_API_KEY"
macOS / Linux
export CODEFORGE_API_KEY="YOUR_API_KEY"

Request headers

OpenAI examples use Authorization: Bearer. Anthropic examples use x-api-key and anthropic-version. Both key formats are accepted by the gateway. Inference requests use API-key authentication, independently of your browser session.

Models

Limits and reasoning settings come from the live Central Hub catalog. The public catalog is an overview; the models available to your API key depend on your account’s access policy.

ModelContext window (tokens)Maximum input (tokens)Maximum output (tokens)Reasoning levels
DeepSeek-V4.1-Flash (CH-AI)
DeepSeek-V4.1-Flash
chat/completions
1,000,000128,000384,000 low medium (Default) high max
DeepSeek-V4-Pro (CH-AI)
DeepSeek-V4-Pro
chat/completions
1,000,000128,000384,000 medium (Default) high max
GLM-5.3 (CH-AI)
GLM-5.3
chat/completions
1,000,000128,000131,072 low (Default) high max
GLM-5.3-Flash (CH-AI)
GLM-5.3-Flash
chat/completions
1,000,000128,000131,072 low (Default) high max
GPT-5.5 (CH-AI)
GPT-5.5
responses
272,000128,000128,000 low (Default) medium high xhigh
GPT-5.6-Luna (CH-AI)
GPT-5.6-Luna
responses
1,050,000128,000128,000 low (Default) medium high xhigh max
GPT-5.6-Sol (CH-AI)
GPT-5.6-Sol
responses
272,000128,000128,000 low (Default) medium high xhigh max ultra
GPT-5.6-Terra (CH-AI)
GPT-5.6-Terra
responses
272,000128,000128,000 low (Default) medium high xhigh max ultra
GPT-6.1-Sol (CH-AI)
GPT-6.1-Sol
responses
272,000128,000128,000 low (Default) medium high xhigh max ultra
GPT-6-Luna (CH-AI)
GPT-6-Luna
responses
1,050,000128,000128,000 low (Default) medium high xhigh max
GPT-6-Sol (CH-AI)
GPT-6-Sol
responses
272,000128,000128,000 low (Default) medium high xhigh max ultra
Grok-4.5 (CH-AI)
Grok-4.5
chat/completions
500,000128,00033,000 low medium (Default) high
Kimi-K2.6 (CH-AI)
Kimi-K2.6
chat/completions
262,128128,000262,128 Not specified
Kimi-K2.7-Code (CH-AI)
Kimi-K2.7-Code
chat/completions
262,144128,000262,144 Not specified
Minimax-M2.7 (CH-AI)
Minimax-M2.7
chat/completions
196,608128,000196,608 low (Default) medium high
Minimax-M3 (CH-AI)
Minimax-M3
chat/completions
512,000128,000512,000 low (Default) medium high
Qwen3.7-Plus (CH-AI)
Qwen3.7-Plus
chat/completions
1,000,000128,00064,000 Not specified

Selecting a model updates API examples and tool configurations. Use its recommended API first; a route existing on the gateway does not mean every model supports it.

Selected model

Model
DeepSeek-V4.1-Flash (CH-AI)
API model ID
DeepSeek-V4.1-Flash
Proxy model name
DeepSeek-V4.1-Flash
Recommended API
chat/completions
Context window (tokens)
1,000,000
Maximum input (tokens)
128,000
Maximum output (tokens)
384,000
Catalog capabilities
Text, Web search, Vision, News search
Input modalities
Not specified
Output modalities
Text
Reasoning levels
low — Default; medium (Default) — Medium; high — High; max — Max
OpenCode provider ID
codeforge-oaic
OpenCode provider package
@ai-sdk/openai-compatible

Discover models with your key

GET /v1/models lists models available to your key. Use the returned id exactly. Catalog metadata is separate from the official inference request and response formats.

GET /v1/models
curl "https://codeforge-oaic.centralhubai.com/v1/models" -H "Authorization: Bearer $CODEFORGE_API_KEY"

Protocol compatibility

The gateway exposes all three routes. OpenAI and Codex models prefer Responses; OpenAI-compatible models prefer Chat Completions; Anthropic models prefer Messages. Existing bridges connect Responses and Messages for supported OpenAI, Codex, and Anthropic routes. Availability and provider-hosted features still depend on the model and configured providers.

API reference

Chat Completions

POST /v1/chat/completions

Send a messages array. Read the assistant message from choices, finish_reason for completion status, and usage for token counts. Streaming returns chunks with incremental delta content.

Examples use official API formats with your endpoint and model ID. Responses below are illustrative; IDs, usage, and additional fields vary. Save the request JSON as request.json before running cURL. On PowerShell, use curl.exe and adapt shell quoting, or use the SDK examples.

Request JSON — save as request.json
{
  "model": "DeepSeek-V4.1-Flash",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ]
}
cURL (macOS / Linux / WSL)
curl "https://codeforge-oaic.centralhubai.com/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CODEFORGE_API_KEY" \
  --data-binary @request.json
Python SDK
import os
from openai import OpenAI

# pip install openai
client = OpenAI(api_key=os.environ["CODEFORGE_API_KEY"], base_url="https://codeforge-oaic.centralhubai.com/v1")
completion = client.chat.completions.create(
    model="DeepSeek-V4.1-Flash", messages=[{"role": "user", "content": "Hello!"}])
print(completion.choices[0].message.content)
JavaScript SDK
import OpenAI from "openai";

// npm install openai
const client = new OpenAI({
  apiKey: process.env.CODEFORGE_API_KEY,
  baseURL: "https://codeforge-oaic.centralhubai.com/v1"
});

const completion = await client.chat.completions.create({
  model: "DeepSeek-V4.1-Flash", messages: [{ role: "user", content: "Hello!" }]
});
console.log(completion.choices[0].message.content);
Illustrative response JSON (selected fields)
{
  "id": "chatcmpl_example", "object": "chat.completion", "created": 1791417600,
  "model": "DeepSeek-V4.1-Flash",
  "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello!" }, "finish_reason": "stop" }],
  "usage": { "prompt_tokens": 10, "completion_tokens": 4, "total_tokens": 14 }
}
Streaming example
import OpenAI from "openai";

// npm install openai
const client = new OpenAI({
  apiKey: process.env.CODEFORGE_API_KEY,
  baseURL: "https://codeforge-oaic.centralhubai.com/v1"
});

const stream = await client.chat.completions.create({
  model: "DeepSeek-V4.1-Flash", messages: [{ role: "user", content: "Hello!" }], stream: true
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Set stream to true to receive server-sent events. With cURL, add -N and set stream in request.json. Chat Completions emits delta chunks and [DONE]; Responses emits typed response events; Messages emits message and content-block events. Handle errors and terminal events as well as text deltas.

Function-tool round trip
import OpenAI from "openai";

// npm install openai
const client = new OpenAI({
  apiKey: process.env.CODEFORGE_API_KEY,
  baseURL: "https://codeforge-oaic.centralhubai.com/v1"
});

const parameters = {
  type: "object", properties: { city: { type: "string" } },
  required: ["city"], additionalProperties: false
};
// Replace this example function with your own validated tool implementation.
const getWeather = ({ city }) => ({ city, temperature_c: 22 });

const tools = [{ type: "function", function: { name: "get_weather", description: "Get weather for a city", parameters } }];
const messages = [{ role: "user", content: "What is the weather in Cape Town?" }];
const first = await client.chat.completions.create({ model: "DeepSeek-V4.1-Flash", messages, tools });
const assistant = first.choices[0].message;
const calls = assistant.tool_calls ?? [];
if (calls.length) {
  const results = calls.map(call => {
    if (call.type !== "function" || call.function.name !== "get_weather") throw new Error("Unknown tool");
    return { role: "tool", tool_call_id: call.id, content: JSON.stringify(getWeather(JSON.parse(call.function.arguments))) };
  });
  const final = await client.chat.completions.create({ model: "DeepSeek-V4.1-Flash", tools, messages: [...messages, assistant, ...results] });
  console.log(final.choices[0].message.content);
} else console.log(assistant.content);

Use a model that supports function calling. Your application executes tools, validates arguments, and returns results with the original call ID. These examples include one tool round trip; repeat the loop if the model requests more tools. The weather result is demonstration data.

Official reference
API reference

Responses

POST /v1/responses

Send input as text or an array of input items. Raw JSON returns an output array containing messages, reasoning, or function calls. The SDK’s output_text is a convenience accessor, not a raw JSON response field.

This example uses a different protocol from the selected model’s recommended API. Check compatibility before running it.

Examples use official API formats with your endpoint and model ID. Responses below are illustrative; IDs, usage, and additional fields vary. Save the request JSON as request.json before running cURL. On PowerShell, use curl.exe and adapt shell quoting, or use the SDK examples.

Request JSON — save as request.json
{
  "model": "DeepSeek-V4.1-Flash",
  "input": "Hello!"
}
cURL (macOS / Linux / WSL)
curl "https://codeforge-oaic.centralhubai.com/v1/responses" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CODEFORGE_API_KEY" \
  --data-binary @request.json
Python SDK
import os
from openai import OpenAI

# pip install openai
client = OpenAI(api_key=os.environ["CODEFORGE_API_KEY"], base_url="https://codeforge-oaic.centralhubai.com/v1")
response = client.responses.create(model="DeepSeek-V4.1-Flash", input="Hello!")
print(response.output_text)
JavaScript SDK
import OpenAI from "openai";

// npm install openai
const client = new OpenAI({
  apiKey: process.env.CODEFORGE_API_KEY,
  baseURL: "https://codeforge-oaic.centralhubai.com/v1"
});

const response = await client.responses.create({ model: "DeepSeek-V4.1-Flash", input: "Hello!" });
console.log(response.output_text);
Illustrative response JSON (selected fields)
{
  "id": "resp_example", "object": "response", "created_at": 1791417600,
  "status": "completed", "model": "DeepSeek-V4.1-Flash",
  "output": [{
    "id": "msg_example", "type": "message", "role": "assistant", "status": "completed",
    "content": [{ "type": "output_text", "text": "Hello!", "annotations": [] }]
  }],
  "usage": { "input_tokens": 10, "output_tokens": 4, "total_tokens": 14 }
}
Streaming example
import OpenAI from "openai";

// npm install openai
const client = new OpenAI({
  apiKey: process.env.CODEFORGE_API_KEY,
  baseURL: "https://codeforge-oaic.centralhubai.com/v1"
});

const stream = await client.responses.create({ model: "DeepSeek-V4.1-Flash", input: "Hello!", stream: true });
for await (const event of stream) {
  if (event.type === "response.output_text.delta") process.stdout.write(event.delta);
}

Set stream to true to receive server-sent events. With cURL, add -N and set stream in request.json. Chat Completions emits delta chunks and [DONE]; Responses emits typed response events; Messages emits message and content-block events. Handle errors and terminal events as well as text deltas.

Function-tool round trip
import OpenAI from "openai";

// npm install openai
const client = new OpenAI({
  apiKey: process.env.CODEFORGE_API_KEY,
  baseURL: "https://codeforge-oaic.centralhubai.com/v1"
});

const parameters = {
  type: "object", properties: { city: { type: "string" } },
  required: ["city"], additionalProperties: false
};
// Replace this example function with your own validated tool implementation.
const getWeather = ({ city }) => ({ city, temperature_c: 22 });

const tools = [{ type: "function", name: "get_weather", description: "Get weather for a city", parameters, strict: true }];
const input = [{ role: "user", content: "What is the weather in Cape Town?" }];
const first = await client.responses.create({ model: "DeepSeek-V4.1-Flash", input, tools, store: false });
const calls = first.output.filter(item => item.type === "function_call");
if (calls.length) {
  const results = calls.map(call => {
    if (call.name !== "get_weather") throw new Error("Unknown tool");
    return { type: "function_call_output", call_id: call.call_id, output: JSON.stringify(getWeather(JSON.parse(call.arguments))) };
  });
  const final = await client.responses.create({
    model: "DeepSeek-V4.1-Flash", tools, store: false, input: [...input, ...first.output, ...results]
  });
  console.log(final.output_text);
} else console.log(first.output_text);

Use a model that supports function calling. Your application executes tools, validates arguments, and returns results with the original call ID. These examples include one tool round trip; repeat the loop if the model requests more tools. The weather result is demonstration data.

Official reference
API reference

Messages

POST /v1/messages

Send messages and max_tokens. System instructions use the top-level system field. Read content blocks, stop_reason, and usage. Keep the anthropic-version header when making raw HTTP requests.

This example uses a different protocol from the selected model’s recommended API. Check compatibility before running it.

Examples use official API formats with your endpoint and model ID. Responses below are illustrative; IDs, usage, and additional fields vary. Save the request JSON as request.json before running cURL. On PowerShell, use curl.exe and adapt shell quoting, or use the SDK examples.

Request JSON — save as request.json
{
  "model": "DeepSeek-V4.1-Flash",
  "max_tokens": 256,
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ]
}
cURL (macOS / Linux / WSL)
curl "https://codeforge-oaic.centralhubai.com/v1/messages" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $CODEFORGE_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  --data-binary @request.json
Python SDK
import os
from anthropic import Anthropic

# pip install anthropic
client = Anthropic(api_key=os.environ["CODEFORGE_API_KEY"],
                   base_url="https://codeforge-oaic.centralhubai.com")
message = client.messages.create(
    model="DeepSeek-V4.1-Flash", max_tokens=256,
    messages=[{"role": "user", "content": "Hello!"}])
print("".join(block.text for block in message.content if block.type == "text"))
JavaScript SDK
import Anthropic from "@anthropic-ai/sdk";

// npm install @anthropic-ai/sdk
const client = new Anthropic({
  apiKey: process.env.CODEFORGE_API_KEY,
  baseURL: "https://codeforge-oaic.centralhubai.com"
});

const message = await client.messages.create({
  model: "DeepSeek-V4.1-Flash", max_tokens: 256,
  messages: [{ role: "user", content: "Hello!" }]
});
console.log(message.content.filter(b => b.type === "text").map(b => b.text).join(""));
Illustrative response JSON (selected fields)
{
  "id": "msg_example", "type": "message", "role": "assistant",
  "model": "DeepSeek-V4.1-Flash", "content": [{ "type": "text", "text": "Hello!" }],
  "stop_reason": "end_turn", "stop_sequence": null,
  "usage": { "input_tokens": 10, "output_tokens": 4 }
}
Streaming example
import Anthropic from "@anthropic-ai/sdk";

// npm install @anthropic-ai/sdk
const client = new Anthropic({
  apiKey: process.env.CODEFORGE_API_KEY,
  baseURL: "https://codeforge-oaic.centralhubai.com"
});

const stream = await client.messages.create({
  model: "DeepSeek-V4.1-Flash", max_tokens: 256, stream: true,
  messages: [{ role: "user", content: "Hello!" }]
});
for await (const event of stream) {
  if (event.type === "content_block_delta" && event.delta.type === "text_delta") {
    process.stdout.write(event.delta.text);
  }
}

Set stream to true to receive server-sent events. With cURL, add -N and set stream in request.json. Chat Completions emits delta chunks and [DONE]; Responses emits typed response events; Messages emits message and content-block events. Handle errors and terminal events as well as text deltas.

Function-tool round trip
import Anthropic from "@anthropic-ai/sdk";

// npm install @anthropic-ai/sdk
const client = new Anthropic({
  apiKey: process.env.CODEFORGE_API_KEY,
  baseURL: "https://codeforge-oaic.centralhubai.com"
});

const parameters = {
  type: "object", properties: { city: { type: "string" } },
  required: ["city"], additionalProperties: false
};
// Replace this example function with your own validated tool implementation.
const getWeather = ({ city }) => ({ city, temperature_c: 22 });

const tools = [{ name: "get_weather", description: "Get weather for a city", input_schema: parameters }];
const messages = [{ role: "user", content: "What is the weather in Cape Town?" }];
const first = await client.messages.create({ model: "DeepSeek-V4.1-Flash", max_tokens: 1024, tools, messages });
const calls = first.content.filter(b => b.type === "tool_use");
if (calls.length) {
  const results = calls.map(call => {
    if (call.name !== "get_weather") throw new Error("Unknown tool");
    return { type: "tool_result", tool_use_id: call.id, content: JSON.stringify(getWeather(call.input)) };
  });
  const final = await client.messages.create({
    model: "DeepSeek-V4.1-Flash", max_tokens: 1024, tools,
    messages: [...messages, { role: "assistant", content: first.content }, { role: "user", content: results }]
  });
  console.log(final.content);
} else console.log(first.content);

Use a model that supports function calling. Your application executes tools, validates arguments, and returns results with the original call ID. These examples include one tool round trip; repeat the loop if the model requests more tools. The weather result is demonstration data.

Official reference
Integrations

OpenCode

Install OpenCode, set CODEFORGE_API_KEY, and merge the generated configuration into opencode.json in your project or ~/.config/opencode/opencode.json. Preserve your existing settings. Restart OpenCode and select the configured provider/model with /models.

This configuration reads the key from your environment. Alternatively, use /connect → Other with the provider ID shown below, and omit options.apiKey so OpenCode uses the saved credential.

Install
npm install -g opencode-ai
opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "codeforge-oaic/DeepSeek-V4.1-Flash",
  "provider": {
    "codeforge-oaic": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Central Hub AI",
      "options": {
        "baseURL": "https://codeforge-oaic.centralhubai.com/v1",
        "apiKey": "{env:CODEFORGE_API_KEY}"
      },
      "models": {
        "DeepSeek-V4.1-Flash": {
          "name": "DeepSeek-V4.1-Flash (CH-AI)",
          "limit": {
            "context": 1000000,
            "input": 128000,
            "output": 384000
          },
          "reasoning": true,
          "variants": {
            "low": {
              "reasoningEffort": "low",
              "reasoningSummary": "auto",
              "textVerbosity": "medium"
            },
            "medium": {
              "reasoningEffort": "medium",
              "reasoningSummary": "auto",
              "textVerbosity": "medium"
            },
            "high": {
              "reasoningEffort": "high",
              "reasoningSummary": "detailed",
              "textVerbosity": "medium"
            },
            "max": {
              "reasoningEffort": "max",
              "reasoningSummary": "detailed",
              "textVerbosity": "medium"
            }
          }
        }
      }
    }
  }
}
Integrations

Codex

Install the official Codex CLI, set CODEFORGE_API_KEY, and merge the configuration below into your user-level ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml). Keep your existing settings and provider entries. Launch codex from your project directory.

Install
npm install -g @openai/codex

Codex uses the Responses protocol. The model_catalog_json artifact in the existing setup guide adds model discovery and metadata. Reasoning settings are included only when advertised by the catalog.

~/.codex/config.toml
Select a model compatible with Responses to generate Codex configuration.

Other harnesses

For any client that supports a custom provider, copy these connection settings. Match the protocol to the selected model. Token limits and reasoning controls are optional client settings when that client supports them.

Client settingValue
API base URLhttps://codeforge-oaic.centralhubai.com/v1
Full request URLhttps://codeforge-oaic.centralhubai.com/v1/chat/completions
API key / credentialCODEFORGE_API_KEY
API model IDDeepSeek-V4.1-Flash
Recommended APIchat/completions
Context window (tokens)1,000,000
Maximum output (tokens)384,000
Reasoning levelslow — Default; medium (Default) — Medium; high — High; max — Max

OpenAI clients and OpenCode expect the base URL including /v1. The official Anthropic SDK appends /v1/messages itself, so its base URL is the root before /v1. Raw HTTP clients use the full request URL. Do not append /v1 or an endpoint twice.

Troubleshooting

SymptomWhat to check
401 — invalid or missing keyCheck the environment variable in the current terminal and the authentication header. Replace revoked, expired, disabled, or deleted keys.
400 — missing modelSend valid JSON with the model field. Copy the API identifier, not the display label.
404 — model unavailableCheck GET /v1/models with the same key. Public catalog visibility does not grant account access.
Access, credits, or usage limit reachedCheck your subscription, API credit balance, and usage in CodeForge Console. Follow the error’s reset or payment guidance.
429 — rate limitReduce concurrency and retry with backoff; honor Retry-After when present. Check account and upstream rate limits.
503 — upstream unavailableCheck the selected model’s recommended protocol. If it is correct, retry later; an upstream connection or account may be temporarily unavailable.
Client cannot connect or finds no modelsCheck the base URL, avoid duplicate /v1, restart after changing environment variables, and configure the exact model ID and supported protocol.
CodeForge Console
Top Settings