Skip to content

LLM Calls

Most ModelPlane configuration happens in the UI at https://app.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 ModelPlane.

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
  }
}

Listing Available Models

GET /v1/models returns the model groups your gateway API key's workspace can call — the OpenAI-compatible model-listing convention, backed by your own model groups instead of a fixed provider catalog.

bash
curl https://api.modelplane.dev/v1/models \
  -H "Authorization: Bearer YOUR_GATEWAY_API_KEY"
json
{
  "object": "list",
  "data": [
    { "id": "smart-llm", "object": "model", "created": 1755000000, "owned_by": "modelplane" },
    { "id": "coding-agent", "object": "model", "created": 1755043200, "owned_by": "modelplane" }
  ]
}

Each id is a model group name — pass it as model in a chat completion request. The list only includes model groups active in your API key's workspace.

Embedding Model Groups

Add ?output_modalities=embeddings to list embedding model groups instead — the resource /v1/embeddings calls route through (see Embedding Model Groups):

bash
curl "https://api.modelplane.dev/v1/models?output_modalities=embeddings" \
  -H "Authorization: Bearer YOUR_GATEWAY_API_KEY"
json
{
  "object": "list",
  "data": [
    {
      "id": "text-embed",
      "object": "model",
      "created": 1755000000,
      "owned_by": "modelplane",
      "dimensions": 1536
    }
  ]
}

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 ModelPlane console.

ModelPlane documentation for multi-model, multi-provider, and coding-plan use cases.