Getting Started as a Consumer

This page walks you through buying your first Inference Unit (1M tokens) and making your first consumption call. You can plug and play our code snippets to get started consuming inference instantly.

Sending your first consumption request

1

Sign up and get your API key

  1. Create an account at app.thegrid.aiarrow-up-right

  2. Create a Consumption Key

  3. Export your key in the terminal so it automatically gets inserted in your requests

export GRID_CONSUMPTION_API_KEY="<your_consumption_key>"

🔒 Always store your keys securely.

2

Buy your first Unit (tokens)

First, select which instrument best suits your needs. Options today include:

  • Text Standard: suited for latency-sensitive UX, high throughput, instantaneous responses

  • Text Prime: suited for higher reasoning quality, thoughtful or calculative responses, deeper workflows

circle-info

You can read more about our instruments here.

Now, from the Trade Inference page, place a Market Buy for 1 Unit.

circle-info

1 Unit is equal to 1 million tokens. They can be input (prompt) or output (completion, reasoning) tokens. You can read more about Units here.

Your Unit will be automatically transferred to your consumption account. You now have 1 million tokens ready for use.

circle-info

You can read more about account types and auto-transfer here.

3

Make your first chat completions call

Call the Consumption API to consume tokens from your active Units.

Simply make your first chat completions request

curl -L https://consumption.api.thegrid.ai/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $GRID_CONSUMPTION_API_KEY" \
  -d '{
    "model": "chat-fast",
    "messages": [
      {"role": "system", "content": "Be concise and correct."},
      {"role": "user", "content": "Write one paragraph on why inference needs a market."}
    ]
  }'

🎉 Congratulations! You're now using the future of AI Inference sourcing.

Keep in mind, the Units you purchase need to be consumed within 4 hours. You can learn more in our Consumption Rules.

Where to go next:

  • Use the Trading API to buy units programmatically.

  • Use our Onboarding Guides for ready-to-go scripts to automate your buying and inference consumption on The Grid. These scripts cover common use cases for production implementation.

  • To ensure performant and efficient service, follow our Best Practices for moving your workloads from other inference providers/aggregators to The Grid

Last updated

Was this helpful?