Prerequisites
- An Auriko API key
- Node.js 18+
Install
Use the provider
Create a provider instance and pass it to any AI SDK function:createAuriko() reads your AURIKO_API_KEY environment variable automatically.
Stream responses
UsestreamText for streaming:
Configure options
| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey | string | AURIKO_API_KEY env | API key |
baseURL | string | "https://api.auriko.ai/v1" | API base URL |
headers | Record<string, string> | undefined | Custom headers |
fetch | typeof fetch | globalThis.fetch | Custom fetch implementation |
routing | RoutingOptions | undefined | Default routing configuration |
metadata | AurikoMetadataParam | undefined | Request metadata (tags, user ID, trace ID) |
Configure routing
Set routing defaults when you create the provider:Access routing metadata
For non-streaming calls, readresult.providerMetadata?.auriko:
await the metadata:
AurikoResponseMetadata from @auriko/ai-sdk-provider for type-safe access.
Configure manually
Alternative: use @ai-sdk/openai directly
Alternative: use @ai-sdk/openai directly
You can point the OpenAI-compatible provider at Auriko’s API:This approach loses automatic routing injection and metadata extraction. You can still pass routing via
body:Notes
@auriko/ai-sdk-provideris in preview (v0.1.0-preview.1). The API may change before 1.0.- The provider inherits all
@ai-sdk/openai-compatiblecapabilities: tool calling, structured output, streaming. - For a standalone TypeScript client, see the TypeScript SDK.
- For streaming patterns, see the streaming guide.
- To choose between integration options, see the integration guide.