Skip to content
GridRouterhome

Search

Search providers, capabilities and pages

Model completion API

ai.complete

Any model through one endpoint, billed at the model's rate.
providers document it
12

Providers

12 providers document model completion in their own API docs. None routes it through GridRouter yet. Scores appear as calls are routed.

What counts as a hit:
A completion with a stop reason.

API

Same input for every provider. Set provider.sort to route by price, reliability or latency, or provider.only to pin providers; X-Grid-Max-Cost caps what one call can spend.

Inputs for ai.complete
InputDescription
model*Model id (required)
prompt*Prompt or messages (required)
Request
curl https://api.gridrouter.io/v1/run/ai.complete \
  -H "Authorization: Bearer $GRID_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Grid-Max-Cost: 0.05" \
  -d '{"input":{"model":"~anthropic/claude-opus-latest","prompt":"Write a first line."},"provider":{"sort":"price"}}'

Fields

The normalized output every provider maps into. Suppliers come from integrated endpoint mappings (verified) or field names in each provider's API docs (claimed by the provider).

Every capability's fields
Output fields for Model completion
FieldTypePIIDescriptionSupplied by
textstringNoneModel outputDeepSeek APIMistral AI APIOpenRouterTogether AIYou.com APIs
modelstringNoneModel idDeepSeek APIMistral AI APIOpenRouterTogether AI
finish_reasonstringNoneWhy generation stoppedMistral AI APIOpenRouter
input_tokensintegerNonePrompt tokensNot mapped yet
output_tokensintegerNoneCompletion tokensNot mapped yet