Skip to content

Quickstart

Make your first Twotic API call in under five minutes: create a key, subscribe to an API, and read the cost off the response header.

Twotic runs every API in its catalogue. You call one endpoint with one key, and the response tells you exactly what it cost.

1. Create a key

Sign in and open your keys. Generating a key shows it exactly once — store it immediately, because only a hash is kept and it cannot be recovered afterwards.

Shell
export TWOTIC_KEY="tk_live_..."

2. Subscribe to an API

Open any API in the catalogue and press Subscribe. This charges nothing. It creates the entitlement the gateway checks and starts that API's free monthly allowance.

3. Make the call

Requests go to https://www.twotic.dev/v1/<api-slug>/<path>, with the key in an Authorization header.

Shell
curl "https://www.twotic.dev/v1/token-counter/models" \
  -H "Authorization: Bearer $TWOTIC_KEY"

Alongside the API's own response you get a few headers of ours:

HeaderMeaning
X-Twotic-CostExactly what this call was charged
X-Twotic-Latency-MsHow long the call took, end to end
X-RateLimit-RemainingCalls left in the current minute
X-Twotic-AllowancePresent when the call came out of your free allowance

4. Watch the meter

The dashboard breaks usage down per API, per endpoint and per day, alongside a log of recent requests with their status and cost.

Next