English

Legacy Completions

Move legacy prompt completion requests to Chat Completions.

Legacy Completions

The legacy POST /v1/completions endpoint returns HTTP 410. Put the original prompt in a user message and read choices[0].message.content.

Migrate a completion request

curl "https://api.apimodel.store/v1/chat/completions" \
  -H "Authorization: Bearer $MODELPORT_API_KEY" \
  -H "Idempotency-Key: YOUR_UNIQUE_REQUEST_KEY" \
  -H "Content-Type: application/json" \
  --data '{"model":"gpt-6-sol","messages":[{"role":"user","content":"Reply with one short sentence."}],"max_tokens":128}'