> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llm7.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage overview

> Quick instructions for core endpoints.

Everything you need to hit the core endpoints in one place.

## Text generation

```python theme={null}
import openai

client = openai.OpenAI(
    base_url="https://api.llm7.io/v1",
    api_key="unused",  # Use a https://dash.llm7.io/ token for higher limits.
)

resp = client.chat.completions.create(
    model="default",  # or "fast", "pro", or a model ID from /v1/models
    messages=[
        {"role": "system", "content": "Answer concisely."},
        {"role": "user", "content": "Give me three onboarding tips for new engineers."},
    ],
    temperature=0.4,
)

print(resp.choices[0].message.content)
```

<Tip>
  Use `model="fast"` for lowest latency and `model="pro"` for higher-quality paid models. See [Available models](/guides/models) for selectors and [Models API](/guides/models-api) for live model details.
</Tip>

## Image generation

```python theme={null}
import base64
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llm7.io/v1",
    api_key=os.environ["LLM7_API_TOKEN"],
)

result = client.images.generate(
    model="gpt-image-2",
    prompt="A clean product photo of a matte black desk lamp on a white desk",
    size="1024x1024",
    n=1,
)

image_bytes = base64.b64decode(result.data[0].b64_json)
with open("generated.png", "wb") as file:
    file.write(image_bytes)
```

<Tip>
  See [Image generation and edits](/guides/image-generation) for edit examples, strict field validation, and normalized response details.
</Tip>
