DragonLair.ai
Get access

Tools & structured outputs

Partial Tools / function calling and structured outputs are capability-gated per selected model. Not yet Full provider parity for every tool dialect.

Tool calls

Send OpenAI-shaped tools / tool_choice when the eligible offer supports them. If the resolved model cannot, the gateway fails closed instead of silently stripping tools.

curl -sS https://api.cybertronic.dev/v1/chat/completions \
  -H "Authorization: Bearer $DAROUTER_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "auto",
    "messages": [{"role":"user","content":"What is the weather in NYC?"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "parameters": {"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}
      }
    }]
  }'

Structured outputs

JSON schema and response-format support depends on the selected model. Pin a model that advertises the required capability when schema fidelity matters.

Try in portal

Portal Playground can exercise chat with tools when signed in — still subject to the same fail-closed rules. No demo-success when the API returns an error.

OpenAPI operations

Contract: /v1/openapi.json.

  • POST /v1/chat/completions — tools / tool_choice when the offer advertises tools (capability-gated)

Check model capability metadata before relying on a particular modality or tool dialect.