Documentation

Quick start

Create a key and make your first request to Claude, GPT, Gemini or Grok through one endpoint, with the OpenAI or Anthropic SDK you already use.

Prerequisites

  1. 1Sign in to Token Share.
  2. 2Open the API Keys page.
  3. 3Click Create key, choose the Inference type, and copy the key that starts with sk-token-. The full key is shown once.
  4. 4Top up with USDT on the Billing page.
  5. 5Install an SDK if you want one: pip install openai anthropic or npm install openai @anthropic-ai/sdk.

Token Share speaks two protocol families: OpenAI-compatible (/v1/chat/completions and /v1/responses) and Anthropic (/v1/messages). Which one a model answers on is fixed by the model and shown on its model page. One key works for all of them.

Choose your protocol

OpenAI Chat Completions — the shape most tools support. Grok and Gemini models answer here.

curl https://token-share.app/v1/chat/completions \
  -H "Authorization: Bearer $TOKEN_SHARE_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "grok-4.6",
    "messages": [{"role": "user", "content": "Say hello in one line."}]
  }'

See what the request cost

Every response carries an x-token-share-request-id header. Pass it to the Billing API with the same key to get that request’s cost and token usage.

# 1. Make a request and keep the id from the response headers
curl -sD - -o /dev/null https://token-share.app/v1/chat/completions \
  -H "Authorization: Bearer $TOKEN_SHARE_KEY" \
  -H "content-type: application/json" \
  -d '{"model": "grok-4.6", "messages": [{"role": "user", "content": "hi"}]}' \
  | grep -i x-token-share-request-id

# 2. Look it up
curl https://token-share.app/v1/billing/requests/<request-id> \
  -H "Authorization: Bearer $TOKEN_SHARE_KEY"

The record is written just after the response finishes. A lookup made the instant a response ends can return 404; retry after a few seconds.

Next steps