This guide explains how to choose an integration mode for the AI Gateway, configure request URLs and API keys, and send model API requests.
Before sending a request, make sure you have the following ready:
A full request URL consists of the gateway base URL, the protocol path prefix, and the endpoint path:
Full Request URL = Gateway Base URL + Protocol Path Prefix + Endpoint Path
https://api.tokencube.net/v2/llm./openai, /anthropic, /gemini). Omit this prefix when using OpenAI-Compatible Mode./chat/completions.You can choose between two integration modes based on your business needs:
The table below lists common chat and content generation endpoints (all using the POST method). Please confirm that your target model supports the corresponding protocol and endpoint before calling.
| Mode / Protocol | Protocol Path Prefix | Endpoint Path |
|---|---|---|
| OpenAI-Compatible Mode | None | /chat/completions |
| OpenAI Protocol | /openai |
/chat/completions |
| Anthropic Protocol | /anthropic |
/v1/messages |
| Gemini Protocol: Non-streaming | /gemini |
/v1beta/models/{model}:generateContent |
| Gemini Protocol: Streaming | /gemini |
/v1beta/models/{model}:streamGenerateContent |
For example, the full URL for the chat completions endpoint in OpenAI-Compatible Mode is:
https://api.tokencube.net/v2/llm/chat/completions
The gateway uses standard Bearer Token authentication. When making an HTTP request, include the Authorization header with your API key:
Authorization: Bearer <YOUR_API_KEY>
Tip: When using official Anthropic or Gemini SDKs with the Native Passthrough Protocol, the gateway also supports provider-native authentication headers (
x-api-keyfor Anthropic andx-goog-api-keyfor Gemini).
The following example shows a complete request calling the claude-sonnet-4-6 model using OpenAI-Compatible Mode (replace <YOUR_API_KEY> with your actual API key):
curl https://api.tokencube.net/v2/llm/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [
{
"role": "user",
"content": "Hello, please introduce yourself."
}
]
}'