FOR DEVELOPERS

Build with the AI Gateway

One API gateway for your application’s AI requests. Start with an application API key and let your configured routing policy choose an eligible model.

quickstart.pyv1
import os
from uuid import uuid4
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["TASKWAY_API_KEY"],
    base_url=os.environ["TASKWAY_BASE_URL"],
)
request_id = str(uuid4())

completion = client.chat.completions.create(
    model="auto",
    messages=[dict(role="user", content="Hello, gateway!")],
    extra_headers=dict([("Idempotency-Key", request_id)]),
)

# completion.choices[0].message.content
i

The gateway supports a defined subset of the OpenAI API. Check the compatibility guide for available models, parameters, and features.

Read compatibility →
01

GET STARTED

Make your first request

Open quickstart ↗
02

API SURFACE

Choose an API for your task