Request reference

The API mirrors the OpenAI format, so any existing examples and libraries work as-is. Below is what you need in practice.

Endpoints

ChatPOST https://api.relaymodels.com/v1/chat/completions
Model listGET https://api.relaymodels.com/v1/models
VectorsPOST https://api.relaymodels.com/v1/embeddings
Speech to textPOST https://api.relaymodels.com/v1/audio/transcriptions

Parameters

ParameterValuePurpose
modelstringmodel name
messagesarrayconversation history: system, user, assistant
temperature0 – 20 is deterministic, higher is more creative
max_tokensnumbercaps the response length
streamtrue / falsestreams the response as it's generated
toolsarrayfunctions the model can call
response_formatobjectstrict JSON in the response
{
  "model": "gpt-5.6-sol",
  "messages": [
    { "role": "system", "content": "Answer briefly and in English." },
    { "role": "user", "content": "What is a vector?" }
  ],
  "temperature": 0.3,
  "max_tokens": 500
}
The system role sets behavior for the whole conversation — put instructions there, not user data.

Response format

{
  "id": "chatcmpl-...",
  "model": "gpt-5.6-sol",
  "choices": [
    {
      "index": 0,
      "finish_reason": "stop",
      "message": { "role": "assistant", "content": "Hello!" }
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 4,
    "total_tokens": 16
  }
}

The usage block shows the actual token usage for the request — handy to log on your side.

Streaming

For chats, turn on streaming: the first words show up almost instantly.

const stream = await client.chat.completions.create({
  model: "gpt-5.6-sol",
  messages: [{ role: "user", content: "Tell me about Lake Baikal" }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

What's next