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/completions

Authenticate with Authorization: Bearer lx1_.... Any model in the catalog is valid in model.

Request parameters

ParameterTypeNotes
modelstring · requiredAny catalog id.
promptstring · requiredRaw text prompt — no message structure.
max_tokensintegerOutput ceiling.
temperaturenumberSampling temperature.
stopstring | string[]Stop sequences.
streambooleanSSE 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
  }'
Request
{
  "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 }
}
Response (shape)

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.