Quickstart
Get up to speed with our API in one minute.
agirouter makes it easy to run leading open-source models using only a few lines of code.
First, register for an account to get an API key. New accounts come with $1 to get started.
Once you've registered, set your account's API key to an environment variable named:
export agirouter_API_KEY=xxxxxagirouter provides an official library for Python and TypeScript, or you can call our HTTP API in any language you want.
pip install agirouterChoose a model to query. In this example, we'll do a chat completion on Llama 3.1 8B with streaming:
from agirouter import agirouter
client = agirouter()
completion = client.chat.completions.create(
model="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
messages=[{"role": "user", "content": "What are the top 3 things to do in New York?"}],
)- Explore our Quickstart to get started with our API in 1 minute.
- Explore our Cookbook for Python recipes with agirouter.
- Explore our Demos for full-stack open-source example apps.
- Check out the agirouter Playground to try out different models.
- See Our Integrations with leading LLM frameworks.