EUrouter

Completions

Create legacy text completions from a prompt through the OpenAI-compatible EUrouter API, served by EU-hosted model providers.

OpenAPI JSON

Create text completion

POST
/api/v1/completions

Generate a text completion using the specified model. Supports streaming and fallback routing.

Authorization

bearerAuth
AuthorizationBearer <token>

API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.eurouter.ai/api/v1/completions" \  -H "Content-Type: application/json" \  -d '{    "model": "mistral-large-3",    "prompt": "Write a short greeting."  }'
{
  "id": "string",
  "object": "text_completion",
  "created": 0,
  "model": "string",
  "provider": "string",
  "system_fingerprint": "string",
  "choices": [
    {
      "text": "string",
      "index": 0,
      "finish_reason": "stop",
      "native_finish_reason": "string",
      "logprobs": {
        "tokens": [
          "string"
        ],
        "token_logprobs": [
          0
        ],
        "top_logprobs": [
          {
            "property1": 0,
            "property2": 0
          }
        ],
        "text_offset": [
          0
        ]
      },
      "reasoning": "string"
    }
  ],
  "usage": {
    "prompt_tokens": -9007199254740991,
    "completion_tokens": -9007199254740991,
    "total_tokens": -9007199254740991,
    "cost": 0,
    "cost_currency": "USD",
    "cost_eur": 0,
    "is_byok": true,
    "prompt_tokens_details": {
      "cached_tokens": -9007199254740991,
      "cache_write_tokens": -9007199254740991,
      "audio_tokens": -9007199254740991,
      "property1": null,
      "property2": null
    },
    "completion_tokens_details": {
      "cached_tokens": -9007199254740991,
      "cache_write_tokens": -9007199254740991,
      "audio_tokens": -9007199254740991,
      "property1": null,
      "property2": null
    },
    "cost_details": {
      "upstream_inference_cost": 0,
      "upstream_inference_prompt_cost": 0,
      "upstream_inference_completions_cost": 0,
      "upstream_inference_uncached_prompt_cost": 0,
      "upstream_inference_cache_read_cost": 0,
      "upstream_inference_cache_write_cost": 0
    }
  }
}
{
  "error": {
    "code": 403,
    "message": "string",
    "type": "permission_error",
    "param": null,
    "details": {
      "reason": "string",
      "reasons": [
        {
          "code": "string",
          "layer": "org"
        }
      ]
    }
  },
  "requestId": "string"
}

Was this page helpful?

Still stuck? Contact support