Legacy completions

POST /v1/completions takes a single string prompt and is served as a chat completion.

On this page

POST /v1/completions is the older OpenAI text-completion shape: a prompt string in, choices[].text out. The devshard gateways speak chat completions, so OpenBroker translates the body and translates the response back.

bash
curl https://api.openbroker.gonka.gg/v1/completions \
  -H "Authorization: Bearer obk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMaxAI/MiniMax-M2.7",
    "prompt": "Explain devshards in one sentence.",
    "max_tokens": 100
  }'

What is accepted

  • prompt must be a single string. A one-element array of one string is also accepted.
  • Auth, billing, and streaming follow the same rules as chat completions. stream: true works. The translated stream is rewritten into the legacy chunk shape.

What is rejected or dropped

InputResult
Missing prompt400 missing required field: prompt
An array of several prompts, or token-id prompts400 — batch prompts are not supported
suffix, echo, best_of, logprobsRemoved before the call. They have no chat equivalent here, and they do not fail the request.

Prefer /v1/chat/completions for new integrations. The legacy route exists so older clients can switch base URL and key without rewriting the prompt field.