EUrouter

Chat

Chat completion endpoints

Create chat completion

POST
/api/v1/chat/completions

Authorization

bearerAuth
AuthorizationBearer <token>

API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

In: header

Request Body

application/json

model?string

Model identifier (e.g., "openai/gpt-4")

models?array<string>

Fallback model list (not yet implemented)

rule_id?string

Routing rule ID to apply

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
rule_name?string

Routing rule name to apply

messages*

Conversation messages

Items1 <= items
stream?boolean|

Enable streaming responses

stream_options?|

Streaming options

max_tokens?number|

Maximum tokens to generate (deprecated, use max_completion_tokens)

max_completion_tokens?number|

Maximum tokens to generate

temperature?number|

Sampling temperature (0-2)

top_p?number|

Nucleus sampling probability (0-1)

frequency_penalty?number|

Frequency penalty (-2 to 2)

presence_penalty?number|

Presence penalty (-2 to 2)

logit_bias?|

Token logit biases

logprobs?boolean|

Return log probabilities

top_logprobs?number|

Number of top logprobs to return (0-20)

seed?integer|

Random seed for deterministic generation

stop?|

Stop sequences

reasoning?

Reasoning parameters (for reasoning models)

response_format?||||

Response format specification

tool_choice?string|string|string|

Tool calling behavior

tools?

Available tools for the model

user?string

End-user identifier for abuse detection

metadata?

Custom metadata

provider?

Provider routing preferences

Response Body

application/json

curl -X POST "https://api.eurouter.ai/api/v1/chat/completions" \  -H "Content-Type: application/json" \  -d '{    "messages": [      {        "role": "system",        "content": "string"      }    ]  }'
{
  "id": "string",
  "object": "chat.completion",
  "created": 0,
  "model": "string",
  "system_fingerprint": "string",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "string",
        "name": "string",
        "tool_calls": [
          {
            "id": "string",
            "type": "function",
            "function": {
              "name": "string",
              "arguments": "string"
            }
          }
        ],
        "refusal": "string",
        "reasoning": "string"
      },
      "finish_reason": "tool_calls",
      "logprobs": {
        "content": [
          {
            "token": "string",
            "logprob": 0,
            "bytes": [
              0
            ],
            "top_logprobs": [
              {
                "token": "string",
                "logprob": 0,
                "bytes": [
                  0
                ]
              }
            ]
          }
        ],
        "refusal": [
          {
            "token": "string",
            "logprob": 0,
            "bytes": [
              0
            ],
            "top_logprobs": [
              {
                "token": "string",
                "logprob": 0,
                "bytes": [
                  0
                ]
              }
            ]
          }
        ]
      }
    }
  ],
  "usage": {
    "completion_tokens": 0,
    "prompt_tokens": 0,
    "total_tokens": 0,
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    },
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "audio_tokens": 0
    }
  }
}