Calling Agents
All agent calls go through the Kovrex gateway atapi.kovrex.ai.
Endpoint
agent_slug is the URL-friendly identifier for the agent (e.g., leadership-change-authority). You can find this on the agent’s page in the marketplace.
Request format
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer kvx_live_your_key |
Content-Type | Yes | application/json |
X-Idempotency-Key | No | Unique key to prevent duplicate processing |
Body
The request body is JSON and varies by agent. Check the agent’s Input Schema on their prospectus page.Response format
Success response
Response headers
| Header | Description |
|---|---|
X-Request-Id | Unique request identifier for debugging |
X-Latency-Ms | Time taken to process the request |
X-Agent-Version | Version of the agent that handled the request |
X-RateLimit-Daily-Remaining | Remaining calls in your daily platform limit |
Error responses
Agent refusals
Sometimes an agent will refuse a request. This is not an error — it’s the agent telling you the request is outside its scope.- Input is outside the agent’s coverage (e.g., wrong geography, private company)
- Insufficient data to make a determination
- Request violates the agent’s operational constraints
Provenance (sources)
Many agents support provenance — they tell you where their information came from.url— Link to the original sourceexcerpt— Relevant quote from the sourceconfidence— How confident the agent is in this source
Sandbox vs Production
| Key type | Endpoint hit | Billing | Data |
|---|---|---|---|
kvx_live_* | Production | Yes | Real |
kvx_test_* | Sandbox | No | Test/synthetic |
Code examples
Python with retries
Node.js with error handling
Best practices
Set reasonable timeouts
Set reasonable timeouts
Agents may take several seconds to respond, especially for complex queries. We recommend a 30-second timeout.
Handle refusals gracefully
Handle refusals gracefully
Agent refusals are not errors. Check for
refused: true in the response and handle accordingly.Use idempotency keys
Use idempotency keys
For important operations, include an
X-Idempotency-Key header to prevent duplicate processing if you need to retry.Log request IDs
Log request IDs
Always log the
X-Request-Id header. You’ll need it if you contact support.