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

# Client quickstart

> Point an OpenAI SDK at the gateway and make your first request in Python or JavaScript.

You need a public gateway origin and an application API key. Do not use an admin key in application code.

## Discover your configuration

```bash theme={null}
export GATEWAY_URL='https://gateway.example.com'
export GATEWAY_API_KEY='...'

curl -sS "$GATEWAY_URL/v1/gateway/info" \
  -H "Authorization: Bearer $GATEWAY_API_KEY"
```

The response includes `gateway_url`, `openai_base_url`, allowed model aliases, and supported paths.

## Python

```python theme={null}
import os
from openai import OpenAI

client = OpenAI(
    base_url=os.environ["GATEWAY_URL"].rstrip("/") + "/v1",
    api_key=os.environ["GATEWAY_API_KEY"],
)

response = client.chat.completions.create(
    model="fast",
    messages=[{"role": "user", "content": "Summarize this incident."}],
    max_completion_tokens=300,
)
print(response.choices[0].message.content)
```

## JavaScript

```javascript theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: `${process.env.GATEWAY_URL.replace(/\/$/, "")}/v1`,
  apiKey: process.env.GATEWAY_API_KEY,
});

const stream = await client.chat.completions.create({
  model: "fast",
  messages: [{ role: "user", content: "Summarize this incident." }],
  max_completion_tokens: 300,
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
```

## Images

Vision-enabled aliases accept OpenAI-compatible remote image URLs and inline `data:` URLs. The gateway passes media blocks to the provider; it does not download, scan, or store files.

## Application practices

* Use one key per organization, application, and environment.
* Use stable aliases returned by `/v1/models`; do not hard-code provider deployment names.
* Set explicit output token limits for TPM-limited or budgeted keys.
* Persist `X-Request-ID` with your application logs.
* Keep direct-provider URL/key variables available during an initial migration rollback window.
