> ## Documentation Index
> Fetch the complete documentation index at: https://tokonomics.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Started with Tokonomics: Make Your First Metered Call

> Set up Tokonomics in under five minutes: create a free account, generate your API key, and point your existing LLM client at the proxy.

Tokonomics requires no SDK, no new library, and no changes to your prompt logic. All you do is point your existing LLM client at a different base URL and add one authentication header. This guide walks you from zero to your first metered API call in five minutes.

<Steps>
  <Step title="Create your account">
    Go to [tokonomics.ca/register](https://tokonomics.ca/register) and sign up for a free account. No credit card is required. Your free plan activates immediately and includes 100 tracked calls per month — enough to explore the dashboard and verify your integration before upgrading.
  </Step>

  <Step title="Get your API key">
    Once you're logged in, open your dashboard and navigate to **API Keys**, then click **Create key**. Give the key a descriptive name (for example, `production-backend` or `dev-local`) so you can identify it later.

    Your new key has the format `mk_` followed by 48 hexadecimal characters:

    ```text theme={null}
    mk_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6
    ```

    <Warning>
      Your API key is displayed in plaintext exactly once, at the moment of creation. Copy it to a password manager or secrets store immediately — you cannot retrieve the plaintext value again after you close the dialog.
    </Warning>
  </Step>

  <Step title="Route requests through Tokonomics">
    Replace your LLM provider's base URL with the corresponding Tokonomics proxy URL. The pattern is:

    ```text theme={null}
    https://tokonomics.ca/proxy/{provider}/{path}
    ```

    Where `{provider}` is the lowercase provider slug (e.g., `openai`, `anthropic`, `gemini`) and `{path}` is whatever path your SDK normally appends.

    #### OpenAI

    <CodeGroup>
      ```python Python — before theme={null}
      from openai import OpenAI

      client = OpenAI(
          api_key="sk-your-openai-key",
          # No base_url set — defaults to https://api.openai.com/v1
      )
      ```

      ```python Python — after theme={null}
      from openai import OpenAI

      client = OpenAI(
          api_key="mk_your_tokonomics_key",
          base_url="https://tokonomics.ca/proxy/openai/",
      )
      ```

      ```typescript Node.js — before theme={null}
      import OpenAI from "openai";

      const client = new OpenAI({
        apiKey: "sk-your-openai-key",
        // No baseURL set — defaults to https://api.openai.com/v1
      });
      ```

      ```typescript Node.js — after theme={null}
      import OpenAI from "openai";

      const client = new OpenAI({
        apiKey: "mk_your_tokonomics_key",
        baseURL: "https://tokonomics.ca/proxy/openai/",
      });
      ```
    </CodeGroup>

    #### Anthropic

    <CodeGroup>
      ```python Python — before theme={null}
      import anthropic

      client = anthropic.Anthropic(
          api_key="sk-ant-your-anthropic-key",
          # No base_url set — defaults to https://api.anthropic.com
      )
      ```

      ```python Python — after theme={null}
      import anthropic

      client = anthropic.Anthropic(
          api_key="mk_your_tokonomics_key",
          base_url="https://tokonomics.ca/proxy/anthropic/",
      )
      ```

      ```typescript Node.js — before theme={null}
      import Anthropic from "@anthropic-ai/sdk";

      const client = new Anthropic({
        apiKey: "sk-ant-your-anthropic-key",
        // No baseURL set — defaults to https://api.anthropic.com
      });
      ```

      ```typescript Node.js — after theme={null}
      import Anthropic from "@anthropic-ai/sdk";

      const client = new Anthropic({
        apiKey: "mk_your_tokonomics_key",
        baseURL: "https://tokonomics.ca/proxy/anthropic/",
      });
      ```
    </CodeGroup>
  </Step>

  <Step title="Make your first call">
    Send a request directly with curl to confirm your key is working and the proxy is routing correctly:

    ```bash theme={null}
    curl https://tokonomics.ca/proxy/openai/chat/completions \
      -H "Authorization: Bearer mk_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-4o",
        "messages": [{"role": "user", "content": "Hello!"}]
      }'
    ```

    You'll receive the standard OpenAI response body unchanged. Check the response headers for metering metadata that Tokonomics adds on the way back:

    | Header               | Description                                                                   |
    | -------------------- | ----------------------------------------------------------------------------- |
    | `X-Metering-Latency` | Total round-trip time in milliseconds from proxy ingress to provider response |

    A successful response confirms that your key is valid and that token usage has been recorded on your account.
  </Step>

  <Step title="Check your dashboard">
    Open [tokonomics.ca](https://tokonomics.ca) and navigate to your dashboard. You'll see the call you just made listed under **Recent requests**, along with the token count, USD cost, model, latency, and timestamp. Your cumulative spend and usage totals update in real time with every request.
  </Step>
</Steps>

<Tip>
  Add the `X-Metering-Tags` header to any request to attribute cost to a specific team, feature, or user:

  ```bash theme={null}
  -H 'X-Metering-Tags: {"team":"growth","feature":"chatbot"}'
  ```

  Tags are stored alongside every request record and let you slice your spend on any custom dimension in the dashboard or via the API. See [Tag-based Attribution](/concepts/tagging) for the full tagging reference.
</Tip>

Ready to go deeper? Explore the [API Reference](/api-reference/overview) for every supported endpoint, provider slug, and query parameter.
