November 2026 release is live Read More
Breadcrumbs

OpenRouter and Agentgateway FAQ

OpenRouter

OpenRouter limitations

  • Every request needs an agent tag. OpenRouter does not infer the agent. Requests without agent_id in the trace object are Unattributed.

  • Only requests made through OpenRouter are included. Calls your agents make directly to a provider are not on this connection.

  • Routing spans are not counted as LLM calls. One model request counts as one LLM call.

  • Tags need the mvk.tags. prefix. Put tags in the trace object as mvk.tags.<key>. Other keys are not read as tags.

Sessions and users

Send session_id and user at the top level of each OpenRouter request. OpenRouter exports them as session.id and user.id, and Mavvrik uses them for the Sessions view and per-user cost.

agentgateway

agentgateway limitations

  • Every request needs agent headers. Requests without x-agent-id are Unattributed, including requests from the agentgateway Chat Playground and unchanged Client Setup snippets.

  • Only requests that go through the gateway are included. Calls your agents make directly to a provider are not on this connection.

  • Tools your agent runs in its own code are counted only with an extra line. Add gen_ai.tool_calls: 'llm.toolCalls' under attributes in the tracing block. MCP tools called through the gateway's MCP proxy are always counted.

  • The environment values cannot be set in the agentgateway UI. You can paste the tracing block in Tools → Raw Configuration, but MVK_TENANT_ID, MVK_OTLP_TOKEN and MVK_CONNECTION_ID must be set on the gateway container.

Sessions and users

Send x-session-id and x-user-id headers on each request. The gateway exports them as session.id and user.id, and Mavvrik uses them for the Sessions view and per-user cost.

Troubleshooting

Symptom

Cause

Resolution

Test Connection fails in OpenRouter

The endpoint path is missing

The endpoint must end with /v1/traces

HTTP 401 reported by Broadcast

The headers JSON was edited or is incomplete

Paste the headers JSON from Mavvrik without modification

All traffic appears as Unattributed

Agent ID attribute is unset or incorrect

Set it to trace.metadata.agent_id, and confirm each request carries agent_id

Some agents are missing

Those requests do not carry agent_id

Add the trace object to every request path, including retries and background calls

Reported total differs from OpenRouter

The comparison periods differ, or ingestion is incomplete

Compare identical periods and allow 24 hours for ingestion

agentgateway sends no data

The tracing block is not at the top level of config.yaml, or the environment values are not set

Put frontendPolicies at the top level, set the three Step 1 values, and restart the gateway

agentgateway traffic appears as Unattributed

Requests do not carry x-agent-id

Add the agent headers to every request sent to the gateway

agentgateway tool calls show 0

The gen_ai.tool_calls line is not in the tracing block

Add gen_ai.tool_calls: 'llm.toolCalls' under attributes