# OpenAI SDKs

Use the official Python or TypeScript SDK with Laminarity's base URL.

> Verification: contract-tested; checked 2026-09-01; OpenAI Python SDK, OpenAI JavaScript SDK

## Python

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["LAMINARITY_API_KEY"],
    base_url="https://api.laminarity.ai/v1",
)

available = client.models.list()
print([model.id for model in available.data])

completion = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Give me one launch checklist item."}],
)
print(completion.choices[0].message.content)
```

## TypeScript

```typescript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.LAMINARITY_API_KEY,
  baseURL: "https://api.laminarity.ai/v1",
});

const completion = await client.chat.completions.create({
  model: "auto",
  messages: [{ role: "user", content: "Give me one launch checklist item." }],
});

console.log(completion.choices[0].message.content);
```

## Compatibility boundary

Laminarity implements `chat.completions`, `responses`, and `models`; it does not currently implement Assistants, Embeddings, or image-generation APIs. The most portable cross-provider features are messages, streaming, tools, vision input, temperature/top-p/stop, and completion-token limits.

Advanced fields are accepted for SDK compatibility but may only be honored by providers that support them. Keep provider-specific options out of `auto` workflows unless your project restrictions guarantee the target provider.

## Upstream documentation

- [OpenAI official SDK documentation](https://developers.openai.com/api/docs/libraries)
- [OpenAI Python SDK](https://github.com/openai/openai-python)
- [OpenAI Node SDK](https://github.com/openai/openai-node)
