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
Chat
POST https://api.relaymodels.com/v1/chat/completionsModel list
GET https://api.relaymodels.com/v1/modelsVectors
POST https://api.relaymodels.com/v1/embeddingsSpeech to text
POST https://api.relaymodels.com/v1/audio/transcriptionsParameters
| Parameter | Value | Purpose |
|---|---|---|
model | string | model name |
messages | array | conversation history: system, user, assistant |
temperature | 0 – 2 | 0 is deterministic, higher is more creative |
max_tokens | number | caps the response length |
stream | true / false | streams the response as it's generated |
tools | array | functions the model can call |
response_format | object | strict 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 ?? "");
}