# Quickstart

Make your first eWest request in a few minutes.

eWest gives you video, image and language models behind one OpenAI-compatible API. Requests go to `https://api.ewest.ai/v1` with your key in the `Authorization` header.

1. [Request access](https://ewest.ai/contact?topic=access) (eWest is invite-only for now), then [create an API key](https://ewest.ai/keys) and copy it (it is shown once).
2. Set it as an environment variable: `export EWEST_KEY=sk-…`
3. Send your first request (below). Usage appears in the console under Requests and Usage.

## Your first request

A streamed chat completion. Every other model type works the same way; see [Chat](https://ewest.ai/docs/chat), [Images](https://ewest.ai/docs/images), [Video jobs](https://ewest.ai/docs/video), [Audio](https://ewest.ai/docs/audio) and [Embeddings](https://ewest.ai/docs/embeddings).

cURL:

```bash
curl https://api.ewest.ai/v1/chat/completions \
  -H "Authorization: Bearer $EWEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "ewest/gemini-flash", "stream": true,
       "messages": [{"role": "user", "content": "Hello!"}]}'
```

Python:

```python
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.ewest.ai/v1", api_key=os.environ["EWEST_KEY"])
stream = client.chat.completions.create(
    model="ewest/gemini-flash",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")
```

JavaScript:

```javascript
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.ewest.ai/v1", apiKey: process.env.EWEST_KEY });
const stream = await client.chat.completions.create({
  model: "ewest/gemini-flash",
  messages: [{ role: "user", content: "Hello!" }],
  stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
```

## Next steps

- Pick a model on the [Models](https://ewest.ai/docs/models) page and use its ID in the `model` field.
- Use eWest from your editor or agent: [Developer tools](https://ewest.ai/docs/guides).
- When something fails, the [Errors](https://ewest.ai/docs/errors) page explains each code, and a [trace ID](https://ewest.ai/docs/traces) finds the request in the console.
- API reference: every endpoint, field and error as an [OpenAPI 3.1 spec](https://ewest.ai/openapi.json), for code generators and AI agents.

Source: https://ewest.ai/docs
