Skip to main content

SDK quickstart for curl

A first read-only identity lookup (whoami) is made against the gateway with nothing but curl and an Agent Router API key. The GET /v1/me call 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. A typed client is available for teams that prefer one, covered in 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.