Skip to main content
This guide sends a non-streaming chat request, reads the assistant message, and shows how to switch to the official OpenAI SDK.

1. Create an API key

Sign in to the Yelu dashboard, create an API key, and copy it immediately. Store it in a password manager or secret manager; do not commit it to source control.

2. Set your environment

For persistent local development, use your framework’s ignored environment file. In production, inject the value from your hosting platform’s secret store.

3. Send a request

Model access is account-specific. If the example model is unavailable, call GET /v1/models and use any returned id.

4. Use the OpenAI SDK

Yelu accepts OpenAI-compatible SDK requests. Configure the key and base URL; the rest of your application can use normal SDK methods.

5. Verify the result

A successful Chat Completions response includes an id, model, choices, and usage. The generated text is at choices[0].message.content.

Stream tokens

Render output as the model generates it.

Call tools

Connect models to your application functions.
Last modified on July 13, 2026