Troubleshooting

Tool Calling with OpenAI-Compatible APIs

Choose a model tagged for tool calling or structured output, pass tools in the OpenAI-compatible request body, and keep tool output short enough for context.

Last verified: 2026-06-05

Configuration summary

Base URLhttps://api.metisrouter.com/v1
API keyMETISROUTER_API_KEY
Model IDsCopy exact IDs from /models or /docs/models

Steps

  1. Confirm the request uses https://api.metisrouter.com/v1 or the documented direct provider endpoint.
  2. Copy the exact model ID from /models or /docs/models.
  3. Set a bounded max_tokens, max_completion_tokens, or max_output_tokens value when the task can grow.
  4. Send a short test request and check Usage Logs for the request id, latency, usage, and charged amount.

Symptoms

Agents fail to call tools, return malformed JSON, or ignore schema constraints.

  • The tool may show an authentication, model, streaming, timeout, or provider error.
  • Usage Logs help separate requests blocked by MetisRouter from requests that reached an upstream provider.

Why it happens

Most setup failures come from mismatched base URLs, display names used as model IDs, missing output limits, unsupported endpoint types, or insufficient balance.

  • Use API model IDs, not prettified display names.
  • Match text, image, video, audio, and embedding requests to their documented endpoints.
  • Keep request IDs for support and retries.

How to verify

After applying the fix, run one short request and confirm the platform recorded the model, endpoint, token or asset usage, latency, and cost.

FAQ

Should I retry immediately?

Retry only after checking whether Usage Logs already show a successful upstream request or a billable result.

Which model ID should I use?

Use the exact API model ID from /models or /docs/models. Display titles are not guaranteed to work as request model IDs.