Quick start

Get a key and send your first request in three steps.

tokenfunc gives you Claude, GPT, Gemini, DeepSeek and more behind one address and one key. The API speaks both the OpenAI and the Anthropic formats, so most tools and SDKs only need a new base URL and key.

  1. Get the base URL

    Every request goes to the address below:

    https://tokenfunc.com

    Tools differ in how they want this address, and this is the most common reason an integration fails:

    Protocol the tool usesWhat to enterExample
    OpenAI-compatible (most tools and SDKs)Base URL + /v1https://tokenfunc.com/v1
    Anthropic (Claude Code and similar)Base URL only, no /v1https://tokenfunc.com
    Tools that ask for the full endpointBase URL + full pathhttps://tokenfunc.com/v1/chat/completions

    Tools append their own path to whatever you enter, so one /v1 too many or too few fails with 404. Each tool guide says which form to use.

  2. Create a key

    Sign in, open API Keys and click "Create API Key". Keys start with sk-, and anyone holding one can spend your balance, so treat it like a password.

    • Create one key per tool or project, so a leak only costs you that one key.
    • The full key is shown only once after creation. Copy it right away, and never commit it to a repository or show it in screenshots or group chats.
    • The group you pick decides which models the key can use and at what rate; filter by group on the Model Square to compare models and prices.
    • You can limit a key by quota, models, IP allowlist and expiry. Leave them empty for no limit.

    Screenshot pendingThe API Keys page: the Create API Key button and the copy dialog shown after creationquick-start/create-key.png

  3. Send your first request

    Paste the command below into a terminal. If the model answers, you are all set.

    cURL

    curl https://tokenfunc.com/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
      -d '{
        "model": "gpt-5",
        "messages": [{"role": "user", "content": "Hi, introduce yourself in one sentence."}]
      }'

    PowerShell

    $body = @{
      model    = "gpt-5"
      messages = @(@{ role = "user"; content = "Hi, introduce yourself in one sentence." })
    } | ConvertTo-Json -Depth 5
    
    Invoke-RestMethod -Uri "https://tokenfunc.com/v1/chat/completions" -Method Post `
      -Headers @{ Authorization = "Bearer sk-xxxxxxxxxxxxxxxx" } `
      -ContentType "application/json; charset=utf-8" -Body $body

    Python

    from openai import OpenAI
    
    client = OpenAI(base_url="https://tokenfunc.com/v1", api_key="sk-xxxxxxxxxxxxxxxx")
    
    resp = client.chat.completions.create(
        model="gpt-5",
        messages=[{"role": "user", "content": "Hi, introduce yourself in one sentence."}],
    )
    print(resp.choices[0].message.content)

    Node.js

    import OpenAI from 'openai'
    
    const client = new OpenAI({ baseURL: 'https://tokenfunc.com/v1', apiKey: 'sk-xxxxxxxxxxxxxxxx' })
    
    const resp = await client.chat.completions.create({
      model: 'gpt-5',
      messages: [
        { role: 'user', content: 'Hi, introduce yourself in one sentence.' },
      ],
    })
    console.log(resp.choices[0].message.content)

    Any model from the Model Square works in place of the one above, but the name must match this site's model name exactly, including case and hyphens; the List models endpoint returns the models this key can use. If you get an error, look it up in FAQ and troubleshooting.

Next steps