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-.

HTTP headers
Authorization: Bearer sk-your-key
Content-Type: application/json

POST /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.

ParameterTypeDescription
modelstring, requiredModel ID from the Models page, for example deepseek-v4.1-flash-heretic
messagesarray, requiredConversation messages. Each has a role (system, user, assistant or tool) and content.
streambooleanStream the response. Defaults to false.
max_tokensintegerMaximum number of tokens to generate
temperaturenumberSampling temperature, 0 to 2
top_pnumberNucleus sampling, 0 to 1
stopstring or arrayStop generating when any of these strings appears
tools / tool_choicearray / stringTool calling. Supported by models tagged “Tool calling”.
response_formatobjectRequest JSON output. Supported by some models.
Example request
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
  }'
Example response
{
  "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
curl https://api.geniusrelaygpt.com/v1/models -H "Authorization: Bearer $API_KEY"