curl --request POST \
--url https://api.infyrence.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "claude-sonnet-5",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum entanglement in one sentence."
}
]
}
'{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>",
"name": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"tool_call_id": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"message": "messages: Required",
"type": "invalid_request_error",
"code": null,
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "Insufficient balance. Add funds, or use your own provider key (BYOK) to continue.",
"type": "insufficient_credits",
"code": null,
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "The requested model was not found.",
"type": "not_found",
"code": "model_not_found",
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "Rate limit exceeded. Please slow down.",
"type": "rate_limit_error",
"code": "rate_limited",
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "The model is temporarily unavailable. Please try again in a few moments.",
"type": "upstream_error",
"code": "upstream_unavailable",
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}Create a chat completion
Generate a model response for the given conversation. Set stream: true
to receive the response incrementally as Server-Sent Events (SSE).
curl --request POST \
--url https://api.infyrence.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "claude-sonnet-5",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum entanglement in one sentence."
}
]
}
'{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>",
"name": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"tool_call_id": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"message": "messages: Required",
"type": "invalid_request_error",
"code": null,
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "Insufficient balance. Add funds, or use your own provider key (BYOK) to continue.",
"type": "insufficient_credits",
"code": null,
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "The requested model was not found.",
"type": "not_found",
"code": "model_not_found",
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "Rate limit exceeded. Please slow down.",
"type": "rate_limit_error",
"code": "rate_limited",
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}{
"error": {
"message": "The model is temporarily unavailable. Please try again in a few moments.",
"type": "upstream_error",
"code": "upstream_unavailable",
"request_id": "4f0c2e1a-9b3d-4a2e-8c1f-77a0b2d5e6f1"
}
}Authorizations
Your Infyrence API key, sent as Authorization: Bearer sk-....
Body
The model to use. Any id returned by GET /v1/models.
"claude-sonnet-5"
"gpt-5.5"
"gemini-3.1-pro"
The conversation so far, as a list of messages.
1Show child attributes
Show child attributes
Sampling temperature. Higher is more random.
0 <= x <= 2Nucleus sampling probability mass.
0 <= x <= 1Maximum number of tokens to generate in the completion.
x >= 1If true, stream the response as Server-Sent Events.
Up to a few sequences where generation stops.
Penalize new tokens by their existing frequency in the text so far.
-2 <= x <= 2Penalize new tokens by whether they already appear in the text so far.
-2 <= x <= 2Number of completions to generate.
x >= 1Best-effort deterministic sampling seed.
Response
The chat completion. When stream is false (default), the body is a
single ChatCompletionResponse JSON object. When stream is true,
the body is a text/event-stream of ChatCompletionChunk objects ,
each sent as a data: {...} line, terminated by a final data: [DONE].