Skip to main content

SDK quickstart for curl

This quickstart makes a first read-only identity lookup (whoami) against the gateway using nothing but curl and an API key. The lookup resolves the identity behind an API key with a GET /v1/me call and is safe to run as-is, so it confirms that the key and the base URL are wired together correctly before any billable request is sent.


Prerequisites

Two values and a tool are required before starting:

  • An Agent Router API key. Keys are minted in the Console or with the tare CLI. The secret is shown once, in the form <keyid>.<secret>, so it must be copied immediately. See Make an API call for the key-minting steps.
  • The gateway base URL for the deployment, in the form https://api.<your-domain>. For the hosted service this is https://api.tetrate.ai.
  • curl, which is available by default on macOS and most Linux distributions.

Both values are read from the environment in the call below:

export AGENTROUTER_BASE_URL=https://api.<your-domain>
export AGENTROUTER_API_KEY=<keyid>.<secret>

Install the SDK

No installation is required. curl and an Agent Router API key are sufficient, so there is no SDK or package to download for this path. A typed client is available for teams that prefer one: see the Go, Python, and TypeScript quickstarts.

Make the first call

The request below calls the read-only GET /v1/me endpoint, passing the API key as a bearer token. It returns a JSON object describing the identity associated with the key.

curl "${AGENTROUTER_BASE_URL}/v1/me" \
-H "Authorization: Bearer ${AGENTROUTER_API_KEY}"

Piping the output to a formatter such as jq makes the JSON easier to read:

curl -sS "${AGENTROUTER_BASE_URL}/v1/me" \
-H "Authorization: Bearer ${AGENTROUTER_API_KEY}" | jq

A successful call returns the identity associated with the API key. Because GET /v1/me only reads identity metadata, the call incurs no model usage and can be repeated freely while verifying setup.