QuiverAI
Learn how to use QuiverAI models with the AI SDK.
QuiverAI provides Arrow language models that can reason about and create SVG documents, plus native SVG generation, vectorization, editing, and animation endpoints. The AI SDK provider exposes Arrow 2 through generateText and streamText and exposes image operations through generateImage.
Setup
The QuiverAI provider is available via the @ai-sdk/quiverai module. You can install it with
$ pnpm add @ai-sdk/quiverai
$ npm install @ai-sdk/quiverai
$ yarn add @ai-sdk/quiverai
$ bun add @ai-sdk/quiverai
Provider Instance
You can import the default provider instance quiverai from @ai-sdk/quiverai:
If you need a customized setup, you can import createQuiverAI and create a provider instance with your settings:
You can use the following optional settings to customize the QuiverAI provider instance:
-
baseURL string
Use a different URL prefix for API calls, e.g. to use proxy servers. The default prefix is
https://api.quiver.ai/v1. It also readsQUIVERAI_BASE_URLfrom the environment. -
apiKey string
API key that is sent as a
Bearertoken in theAuthorizationheader. It defaults to theQUIVERAI_API_KEYenvironment variable. -
headers Record<string,string>
Custom headers to include in the requests.
-
fetch (input: RequestInfo, init?: RequestInit) => Promise<Response>
Custom fetch implementation. You can use it as a middleware to intercept requests, or to provide a custom fetch implementation for e.g. testing.
Language Models
Create an Arrow language model by calling the provider or using
.languageModel():
The language-model factory supports arrow-2 and arrow-2-telos through
QuiverAI's stateless POST /v1/responses endpoint.
Reasoning Options
Configure QuiverAI reasoning through providerOptions.quiverai:
- reasoningEffort 'low' | 'medium' | 'high' | 'xhigh'
- reasoningSummary 'auto'
The provider does not request encrypted reasoning. During tool loops it replays the full conversation, matching tool calls and results, and opaque reasoning item IDs in order without resending private reasoning text or encrypted reasoning state.
Caller-Executed Tools
Standard AI SDK tools are sent as Responses API function tools and execute in your application. Use a bounded loop because each step performs another model request:
QuiverAI custom tools return raw strings and are also executed by the caller:
Hosted tools, including legacy quiver:* tools, are not supported.
Responses API Limitations
- Requests are stateless. The provider does not enable response storage or response-ID continuation.
- QuiverAI currently documents text response format for this endpoint.
Structured-output settings are omitted and reported in
warnings. - Streaming tool calls are assembled completely before application execution.
- Abort signals, custom headers, and custom
fetchimplementations are forwarded to the Responses request.
Language Model Usage
result.usage and streaming finish events include input, cache-read,
cache-write, text-output, and reasoning token counts when returned by QuiverAI.
Image Models
You can create QuiverAI image models using the .image() factory method.
For more on image generation with the AI SDK see generateImage().
Basic Usage
QuiverAI returns SVG documents. The generated SVG bytes are available through result.image.uint8Array (or result.images when generating multiple).
Model Capabilities
QuiverAI supports the following Arrow models:
| Model | Description |
|---|---|
arrow-2 | Arrow 2 balances SVG generation quality and speed. Supports SVG editing when enabled for the API key. Uses token-based billing. |
arrow-2-telos | Higher-fidelity Arrow 2 variant for complex designs. Supports SVG editing when enabled for the API key. Uses token-based billing. |
arrow-1 | Base text-to-SVG model. Accepts up to 4 reference images. |
arrow-1.1 | Improved text-to-SVG model. Accepts up to 4 reference images. |
arrow-1.1-max | Higher quality variant with extended context. Accepts up to 16 reference images. |
All models in this table advertise supportsFileInputs: true and
supportsMaskInputs: false. Other model IDs leave both capabilities unknown.
File-input support includes reference images for generation; SVG editing and
animation still require the corresponding providerOptions.quiverai.operation,
supported input formats, and access to that operation for your API key.
Provider Options
You can fine-tune the request using providerOptions.quiverai:
Supported options:
-
operation 'generate' | 'vectorize' | 'edit' | 'animate'
Choose between text-to-SVG generation (
generate, default), image-to-SVG vectorization (vectorize), SVG editing (edit), and SVG animation (animate). -
instructions string
Extra style guidance for prompt-based generation. This option is not used as the SVG edit instruction; use
prompt.textfor editing. -
reasoningEffort 'low' | 'medium' | 'high' | 'xhigh'
Reasoning effort for generation, vectorization, or editing. When omitted, QuiverAI uses its default.
-
attributes object
Requested SVG root attributes. Supports
viewBoxwith numericminX,minY, and positivewidthandheight. This is separate from the unsupportedsizeandaspectRatiooptions. -
temperature number (0-2)
Sampling temperature.
-
topP number (0-1)
Nucleus sampling top-p value.
-
presencePenalty number (-2 to 2)
Presence penalty.
-
maxOutputTokens number
Maximum number of output tokens. Arrow 2 and Arrow 2 Telos accept 1-65536. The provider retains its legacy validation bound of 131072 for other model IDs; the API may enforce a lower model-specific limit.
-
referenceImages
Array<{ url: string } | { base64: string }>Up to four optional reference images for SVG editing. URL references must use HTTP or HTTPS. Base64 references must decode to PNG, JPEG, WebP, GIF, or SVG data. Use
prepareQuiverAIImageReferenceto convert binary, data URL, or URL inputs into this JSON-safe provider option shape. -
maxReviewSteps number (0-5)
Maximum number of edit review and redo steps after the initial edit.
-
orchestratorMaxOutputTokens number (1-65536)
Optional provider orchestrator token budget for SVG editing.
-
shallowMaxOutputTokens number (1-65536)
Optional provider shallow edit token budget for SVG editing.
-
autoCrop boolean
When vectorizing, automatically crop the input image. Only used with
operation: 'vectorize'. -
targetSize number (128-4096)
When vectorizing, target canvas size in pixels. Only used with
operation: 'vectorize'.
Reference Images
Pass reference images through prompt.images:
arrow-1 and arrow-1.1 accept up to 4 reference images. arrow-1.1-max accepts up to 16. For Arrow 2 and other model IDs, the provider allows the endpoint maximum of 16 references and lets the API enforce any lower model-specific limit.
Vectorizing a Raster Image
Set operation to vectorize and pass a single image in prompt.images:
Vectorization returns one SVG per API request. To request multiple vectorizations with n, also set maxImagesPerCall: 1 so generateImage splits them into separate calls.
Editing an SVG
Set operation to edit, put exactly one source SVG in prompt.images, and provide the edit instruction in prompt.text:
The source SVG can be an HTTP/HTTPS URL, binary data such as a Buffer or Uint8Array, a base64 string, or an SVG data URL. Binary and base64 sources are validated as complete UTF-8 SVG documents and sent to QuiverAI as base64 SVG sources. Remote source URLs are fetched by QuiverAI and must resolve to an SVG.
Edit reference images are separate from the source SVG. Put them in providerOptions.quiverai.referenceImages, not prompt.images. Direct provider-option values use { url } or { base64 }; prepareQuiverAIImageReference converts an HTTP/HTTPS URL, URL, Uint8Array, ArrayBuffer, base64 string, or supported image data URL to that JSON-safe shape.
SVG editing has these validation constraints:
- The model must be
arrow-2orarrow-2-telos, and the API key's live model catalog must include thesvg_editoperation. prompt.imagesmust contain exactly one source SVG.prompt.textis required, must not be blank, and must contain at most 4000 characters.- Binary source SVGs must be complete UTF-8 SVG documents no larger than 200000 bytes.
- At most four reference images are accepted. Inline references can contain up to 12582912 decoded bytes.
- Editing returns exactly one SVG per API request. To request multiple edits with
n, setmaxImagesPerCall: 1sogenerateImagesplits them into separate calls. - Masks and generation/vectorization-only provider options are rejected for edits.
- Edit-only provider options are rejected for generation, vectorization, and animation.
The edited SVG is returned as bytes in result.image.uint8Array.
Animating an SVG
Arrow 2 and Arrow 2 Telos can animate an existing SVG. Set operation to animate and pass exactly one source SVG in prompt.images. The text instruction is optional; omit text to let QuiverAI choose an animation.
The animation source can be an HTTP or HTTPS URL, SVG bytes, raw base64, or an image/svg+xml base64 data URL. Local file inputs are inspected before the request and rejected when they do not contain SVG data. Remote URLs are validated for their scheme and fetched and validated by QuiverAI.
Animation returns an animated SVG as bytes in image.uint8Array. When QuiverAI returns timing information, the per-image metadata includes loopPeriodMs and openingAnimationMs; either timing value can be null.
Animation requests must use arrow-2 or arrow-2-telos, contain exactly one source SVG, omit masks, and produce one result per provider request. To request multiple animations with n, set maxImagesPerCall: 1 so generateImage splits them into separate calls. Animation supports temperature, reasoningEffort, and maxOutputTokens; generation-only and vectorization-only provider options are rejected.
Source SVGs, text instructions, and remote source URLs are sent to QuiverAI. Animated SVG is active document content. Sanitize it or render it in an isolated context before embedding output from an untrusted source inline in a page.
Billing and Usage
Arrow 2 models return measured token counts in result.usage. Fixed-credit models may return compatibility token counts of zero; their credit charge is available in result.providerMetadata?.quiverai?.credits when supplied by the API.
Model availability and supported operations depend on your organization and API key permissions. Consult QuiverAI's model catalog for current capabilities and billing.