> Keiro Labs API documentation - Migration
> Page: https://docs.keirolabs.ai/migration.html
> Markdown: https://docs.keirolabs.ai/migration.md
> Agent index: https://docs.keirolabs.ai/llms.txt
> API base URL: https://api.keirolabs.ai/v1
> Auth: send "Authorization: Bearer <api-key>" with a key created in the
> Keiro console (https://console.keirolabs.ai/api-keys). Use credentials saved by
> `keiro setup`, or resolve the key from a secret manager or an owner-only
> secret file and pass it to the client explicitly. Never read another
> provider's variable, and never put raw key material in environment
> variables, code, docs, or logs.

# Migration

Move an existing OpenAI-compatible client to Keiro by changing three explicit
inputs: base URL, credential source, and model ID. Keep request and response
handling on a documented public surface.

## Change the base URL

Use the public `/v1` base once in the client constructor:

```text
https://api.keirolabs.ai/v1
```

Do not append another `/v1`, use a raw origin, or mix public and internal
endpoints in one client.

## Change authentication

Create a workload-specific Keiro key in the console and resolve it through
your approved secret store. Do not reuse an external provider key and do not
put the Keiro secret in source, URLs, shared environment files, or logs.

See [API keys](api-keys.md) for the lifecycle and [SDKs](sdks.md) for
safe constructor examples.

## Change the model ID

Start with `eb1-preview` and use `GET /v1/models` to confirm access. Do not send
raw provider model IDs or private route names. See [Models](models.md) for the
four public paid-beta IDs.

## Choose the matching API surface

- Existing `chat.completions` client: keep the message-array request and use
  [Chat Completions](chat-completions.md).
- Existing Responses client: use [Responses](responses.md).
- Existing Messages client: use [Messages](messages.md) and its documented
  field subset.

Compatibility is strict where documented. Remove unsupported parameters rather
than assuming they will be ignored. In particular, JSON mode and JSON Schema
structured output are not currently supported, while function tools have their
own documented contract.

## Migration checklist

1. Create a dedicated Keiro key.
2. Replace the client base URL.
3. Pass the Keiro key from an approved credential source.
4. Replace the model ID with an account-enabled public eb1 ID.
5. Run one buffered request and assert the documented text field.
6. If used, test streaming terminal and error behavior.
7. If used, test every tool and image workflow rather than only a text prompt.
8. Add `429` and transient `5xx` handling that honors `Retry-After`.
9. Add an idempotency key to retry-sensitive operations.
10. Compare Usage and Logs before moving production traffic.

## Related pages

- [Quickstart](quickstart.md)
- [API reference](api-reference.md)
- [Errors](errors.md)
- [Usage and billing](usage-billing.md)
