Skip to content

LLM Calls

Most One AI Gateway configuration happens in the UI at https://modelplane.dev. Developers only need the LLM base URL, an application API key, and the model group name selected by the product or platform team.

Basic Chat Call

bash
curl https://api.modelplane.dev/v1/chat/completions \
  -H "Authorization: Bearer YOUR_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "coding-agent",
    "messages": [
      { "role": "user", "content": "Review this function and suggest tests." }
    ]
  }'

Using a Model Group

The model value is the model group name from the console. Routing, provider selection, fallback, quota handling, and billing attribution are handled by One AI Gateway.

json
{
  "model": "smart-llm",
  "messages": [
    { "role": "user", "content": "Summarize this incident report." }
  ]
}

Requesting Reasoning

For models and routes that support reasoning, callers can request a thinking budget:

json
{
  "model": "reasoning",
  "messages": [
    { "role": "user", "content": "Find the likely root cause." }
  ],
  "reasoning": {
    "enabled": true,
    "effort": "medium",
    "max_tokens": 2048
  }
}

Response Shape

Final answer content appears in message.content. Reasoning, when returned by the selected provider and model, appears separately.

json
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "The most likely cause is an exhausted database connection pool.",
        "reasoning": "The latency spike aligns with connection waits rather than CPU saturation."
      }
    }
  ]
}

What Developers Do Not Need to Handle

  • Provider API keys.
  • Backend IDs.
  • Routing trees.
  • Plan quota thresholds.
  • Fallback policies.
  • Billing aggregation.

Those are managed in the One AI Gateway console.

Unified AI Gateway documentation for multi-model, multi-provider, and coding-plan use cases.