Documentation Browse guides

Using the HTTP API

Connect your application to Relvo and handle the full request lifecycle.

Base URL and conventions

Base URL
https://api.relvo.si
  1. Send JSON with Content-Type: application/json. Bodies are limited to 64 KiB; quotes, executions, discovery and custom tools allow 1 MiB, and uploads and team skills 16 MiB.
  2. Successful responses are { "data": … }. Errors are { "error": … }; see Troubleshooting.
  3. Timestamps are ISO 8601 strings. Money is integer micros of USD, except GET /tools/usage, which reports amountCents in US cents.
  4. Responses of 8 KiB or more are compressed with Brotli or gzip when you send Accept-Encoding.

Authenticate the request

Create a project key in API keys ↗ with the project:read, tools:read, tools:execute and executions:read scopes, and send it as a bearer credential over HTTPS. Keep it on your server.

Shell
export RELVO_API_URL="https://api.relvo.si"
export RELVO_API_KEY="rlv_..."

GET /tools/project returns the team and project the key belongs to and has no base fee:

curl "$RELVO_API_URL/tools/project" \
  -H "Authorization: Bearer $RELVO_API_KEY"

Discover, quote, execute, read

Find a tool by describing one capability in a few English words. Discovery returns matching tools with their prices; set summary to false to include their input schemas.

curl "$RELVO_API_URL/tools/discover" \
  -H "Authorization: Bearer $RELVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"query":"web search","limit":3}'

Get a free quote for the exact tool and arguments you will run. A quote starts nothing. maximumChargeMicros is the most the call can charge.

curl "$RELVO_API_URL/tools/quote" \
  -H "Authorization: Bearer $RELVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"tool":"web_search","arguments":{"query":"content marketing"}}'

Run the tool with the quote’s priceVersion and maximumChargeMicros. A finished execution returns HTTP 200; one still running returns HTTP 202.

IDEMPOTENCY_KEY=$(uuidgen)

curl "$RELVO_API_URL/tools/web_search" \
  -H "Authorization: Bearer $RELVO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Prefer: wait=25" \
  --data '{
    "tool": "web_search",
    "arguments": { "query": "content marketing" },
    "priceVersion": "<priceVersion from the quote>",
    "maximumChargeMicros": <maximumChargeMicros from the quote>
  }'

Read the execution until its status is no longer queued, running or waiting. output holds the result and chargedMicros the final charge.

curl "$RELVO_API_URL/tools/executions/$EXECUTION_ID" \
  -H "Authorization: Bearer $RELVO_API_KEY" \
  -H "Prefer: wait=25"

Idempotency

Every submission needs an Idempotency-Key header of 8–128 characters: letters, digits, ., _, : or -. Create one per purchase and save it before sending.

  1. The same key with the same body returns the original execution, so retrying after a timeout never pays twice.
  2. The same key with a different body fails with 409 platform_idempotency_key_used_for_another_request.
  3. To find an execution whose response you lost, send { "idempotencyKey": "<key>" } in the body of POST /tools/executions/recover. data.execution is the execution, or null if this API key created none with that key.

Wait for the result

A submission is held open for up to 10 seconds by default and returns as soon as the execution finishes. Prefer: wait=N waits up to N seconds (at most 25); Prefer: respond-async returns immediately.

An execution still in progress returns HTTP 202 with Retry-After: 5. Read GET /tools/executions/{id}, which accepts the same Prefer header, at least 5 seconds apart. When many waits are open at once, Relvo may answer immediately with the current state.

Endpoints

Endpoints
GET  /tools/project · project:read
  The team and project of the key

GET  /tools/usage · usage:read
  This month's requests and spend

GET  /tools · tools:read
  The catalog, whole or in pages of up to 50 (limit, offset)

POST /tools/discover · tools:read
  Tools ranked for one capability

GET  /tools/definition/{name} · tools:read
  One tool's full definition

GET  /tools/connections · tools:read
  The project's connections

POST /tools/quote · tools:read
  A free quote; starts nothing

POST /tools/{tool} · tools:execute
  Reserve the quoted amount and run the tool

POST /tools/executions/recover · tools:execute
  Find an execution by its idempotency key

GET  /tools/executions · executions:read
  Recent executions, newest first (status, tool, limit, before)

GET  /tools/executions/{id} · executions:read
  One execution with its output

GET  /tools/executions/{id}/context · executions:read
  An execution with a bounded result summary

POST /tools/executions/{id}/result · executions:read
  Read part of a large result

POST /tools/executions/{id}/cancel · tools:execute
  Ask an active execution to stop

GET  /tools/executions/{id}/artifacts/{artifactId}/download · executions:read
  A signed download URL for an artifact

POST /tools/upload · tools:execute
  Upload an input file

/tools/project, /tools/usage, /tools/quote, /tools/executions and /tools/connections are also served under /v1. Workflows, triggers and monitors are described in Workflows & triggers.

Build for recovery

Handle non-success responses and preserve the execution ID in your own job record. A submitted request and a finished result are different states.

After an ambiguous timeout, inspect the existing execution. Retry when you have established that another attempt is appropriate for that action.

See Running tools for result handling.

Looking for a specific tool’s inputs and price? Search the catalog