# Any OpenAI-compatible app

Connect Laminarity to a new or unfamiliar application that accepts a custom OpenAI-compatible provider.

> Verification: source-checked; checked 2026-09-25; Generic OpenAI-compatible clients — Configuration labels vary by application; verify the exact fields in the application's provider documentation.

## 1. Check the application's compatibility

Use this setup when an application lets you enter a custom OpenAI base URL, an API key, and a model. The application must support the Chat Completions API. These steps apply to Unreal Agent and other open source or third-party applications that expose those fields, although their labels may differ.

Keep the Laminarity key in a trusted server or local agent process. Do not put it in browser code, a public repository, or a client-side environment variable.

## 2. Enter the connection settings

Choose OpenAI-compatible or Chat Completions as the provider or API type, then enter the following values. Use the base URL exactly as shown; do not append `/chat/completions` unless the application explicitly asks for a full endpoint URL.

```text
Provider: OpenAI-compatible
API type: Chat Completions
Base URL: https://api.laminarity.ai/v1
API key: $LAMINARITY_API_KEY
Model: auto
```

> Note: Start with any extra client-side retry or fallback feature disabled. Laminarity already handles provider fallback when the model is `auto`.

## 3. Verify the key and routing

Test the same key outside the application first. The models request confirms that the key, project policy, and base URL work. The chat request confirms that routing is available before you troubleshoot application-specific settings.

```bash
curl https://api.laminarity.ai/v1/models \
  -H "Authorization: Bearer $LAMINARITY_API_KEY"

curl https://api.laminarity.ai/v1/chat/completions \
  -H "Authorization: Bearer $LAMINARITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Reply with exactly: connected"}]
  }'
```

## 4. Choose routing behavior

Use `auto` when you want Laminarity to select an eligible model and provide automatic fallback. Use a concrete id returned by `GET /models` when the application needs a fixed model. A concrete model bypasses Laminarity model selection and fallback for that request.

If the application caches its model list, refresh it after changing project restrictions or price caps.

## 5. Add advanced features gradually

Confirm a basic text request first. Then test streaming, tools, structured output, and vision one at a time. Third-party applications often make assumptions about optional OpenAI fields, so a basic request helps separate connection problems from feature compatibility problems.

## Troubleshooting

A `401` usually means the key or `/v1` base URL is wrong. A `402` means the balance or key spend cap was exceeded. A `404 model_not_found` means the selected model is unknown or excluded by project policy; query `/v1/models` again. A `429` means the account rate limit was reached.

If a single action creates duplicate requests, disable the application's own retry or fallback setting while testing. If the application requires OpenAI endpoints other than Chat Completions or Responses, check the API reference before assuming they are supported.

## Upstream documentation

- [OpenAI Chat API reference](https://developers.openai.com/api/reference/resources/chat)
