API
API reference
Endpoints, parameters and responses for Chat Completions and Models.
Authentication
Send your key in the Authorization header of every request. Keys are created under API Keys in the console and start with sk-.
Authorization: Bearer sk-your-key
Content-Type: application/jsonPOST /chat/completions
Creates a chat completion. The body is JSON. The most common parameters are listed below; other OpenAI parameters are passed through to the model, and whether they take effect depends on the model.
| Parameter | Type | Description |
|---|---|---|
model | string, required | Model ID from the Models page, for example deepseek-v4.1-flash-heretic |
messages | array, required | Conversation messages. Each has a role (system, user, assistant or tool) and content. |
stream | boolean | Stream the response. Defaults to false. |
max_tokens | integer | Maximum number of tokens to generate |
temperature | number | Sampling temperature, 0 to 2 |
top_p | number | Nucleus sampling, 0 to 1 |
stop | string or array | Stop generating when any of these strings appears |
tools / tool_choice | array / string | Tool calling. Supported by models tagged “Tool calling”. |
response_format | object | Request JSON output. Supported by some models. |
curl https://api.geniusrelaygpt.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-heretic",
"messages": [
{"role": "system", "content": "You are a concise assistant"},
{"role": "user", "content": "Explain what a token is in one sentence"}
],
"max_tokens": 200
}'{
"id": "chatcmpl-3f9a…",
"object": "chat.completion",
"created": 1763000000,
"model": "deepseek-v4.1-flash-heretic",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "A token is the smallest unit of text a model processes…" },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 24, "completion_tokens": 31, "total_tokens": 55 }
}The token counts in usage are what you are billed for. A finish_reason of length means the output was cut off by max_tokens.
GET /models
Returns the IDs of every model the current key can call.
curl https://api.geniusrelaygpt.com/v1/models -H "Authorization: Bearer $API_KEY"