API reference

Completions

Legacy text completions.

On this page

POST/v1/completions

Continues a prompt on a model that serves the completions endpoint.

Auth: API key, or pay per request under https://api.usdf.fi/x402

NameTypeRequiredDescription
modelstringYesA model id that lists completions among its endpoints.
promptstringYesThe text to continue.
max_tokensintegerNoThe most tokens the reply may use.

POST /v1/completions

curl
curl -X POST https://api.usdf.fi/v1/completions \
  -H "Authorization: Bearer $USDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<model>",
    "prompt": "The capital of France is",
    "max_tokens": 16
  }'