Create a chat completion
One clean REST interface for chat, embeddings, images and models. Ship your first request in under five minutes with typed SDKs, copy-paste examples and a simulated playground — no key required to explore.
From zero to your first AI completion in three steps. Copy each command as you go — the whole thing takes about five minutes.
Grab the official client from npm. It ships TypeScript types, automatic retries and streaming helpers, and works with Node 18+ and every major bundler.
$ npm install ai-sdk
Create a secret key in the dashboard, then expose it to your shell. The SDK picks up AI_API_KEY automatically — never hard-code keys or ship them to the browser.
$ export AI_API_KEY="sk-…your-key…"
Send a message to gpt-4o-mini and print the assistant's reply. Swap the model or add stream: true when you're ready for more.
const res = await ai.chat.create({ messages: [{ role: "user", content: "Hello!" }] })
All routes live under https://api.ai.com and authenticate with a bearer token. Pick an endpoint to see its contract.
Compose a request on the left, hit Send Request, and inspect the response on the right. Everything runs locally — responses are simulated and nothing leaves your browser.