API reference · Completions
Completions (legacy).
The legacy OpenAI text-completions dialect — prompt in, text out. Supported so older tools keep working unmodified; new integrations should use Chat Completions.
Endpoint
POST
/v1/completionsAuthenticate with Authorization: Bearer lx1_.... Any model in the catalog is valid in model.
Request parameters
| Parameter | Type | Notes |
|---|---|---|
model | string · required | Any catalog id. |
prompt | string · required | Raw text prompt — no message structure. |
max_tokens | integer | Output ceiling. |
temperature | number | Sampling temperature. |
stop | string | string[] | Stop sequences. |
stream | boolean | SSE chunks when true. |
Example
curl https://api.layerx1.in/v1/completions \
-H "authorization: Bearer $LAYERX1_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "lx1-gpt-oss-120b",
"prompt": "The capital of France is",
"max_tokens": 16
}'{
"id": "cmpl_...",
"object": "text_completion",
"model": "lx1-gpt-oss-120b",
"choices": [{
"index": 0,
"text": " Paris.",
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 6, "completion_tokens": 3, "total_tokens": 9 }
}When to use it
Only when a tool you don't control requires it. Chat-tuned models expect message structure — the same request through Chat Completions will generally behave better, and tools, vision, and structured output live on the chat surfaces only.
Note
Errors follow the OpenAI shape, like Chat Completions — see Errors.