Skip to main content
Use Arbytra as your LLM provider in the Vercel AI SDK with a first-party provider package. This integration is for TypeScript and JavaScript. For Python, use the LangChain or LlamaIndex integration.
@arbytra/ai-sdk-provider is at 0.2.0. Expect API changes before 1.0.

Prerequisites

Install

Use the provider

Create a provider instance and pass it to any AI SDK function:
createArbytra() reads your ARBYTRA_API_KEY environment variable by default.

Stream responses

Use streamText for streaming:

Configure options

createArbytra() accepts these parameters:

Configure routing

Set routing defaults when you create the provider:
For routing parameters, see the routing options guide and advanced routing guide.

Access routing metadata

For non-streaming calls, read result.providerMetadata?.arbytra:
For streaming calls, await the metadata:
Import ArbytraResponseMetadata from @arbytra/ai-sdk-provider for type-safe access.

Configure manually

You can point the OpenAI-compatible provider at Arbytra’s API:
This approach doesn’t include built-in routing or response metadata. You can set a routing strategy with a suffix shortcut (e.g., openai.chat("gpt-4o:cost-focus")). For routing configuration and typed metadata, use @arbytra/ai-sdk-provider.