@coralbricks/ai-sdk-provider
v0.1.1
Published
Vercel AI SDK provider for CoralBricks — GLM and DeepSeek open models with up to 1M context, free cached input.
Maintainers
Readme
@coralbricks/ai-sdk-provider
Vercel AI SDK provider for CoralBricks — open-model inference (GLM 5.3, GLM 5.3 Flash, DeepSeek V4.1 Flash) with up to 1M-token context and free cached input.
A thin, typed wrapper over
@ai-sdk/openai-compatible
that presets the gateway endpoint and model catalog, so it works with zero
configuration like the first-party @ai-sdk/* providers.
Install
npm install @coralbricks/ai-sdk-provider aiUsage
Set CORALBRICKS_API_KEY (get a key at
coralbricks.ai/api-keys), then:
import { generateText } from 'ai'
import { coralbricks } from '@coralbricks/ai-sdk-provider'
const { text } = await generateText({
model: coralbricks('glm-5.3-fp4'),
prompt: 'Explain prompt caching in one sentence.',
})Streaming, tools, and structured output work through the standard AI SDK
functions (streamText, generateObject, …) — CoralBricks speaks the
OpenAI wire format, including streaming tool calls.
Custom instance
import { createCoralBricks } from '@coralbricks/ai-sdk-provider'
const coralbricks = createCoralBricks({
apiKey: process.env.MY_KEY, // default: CORALBRICKS_API_KEY
baseURL: 'https://inference.coralbricks.ai/v1', // default
headers: { 'x-my-header': '1' },
})Models
| Model | Model ID | Context | Input $/M | Cache Write $/M | Output $/M |
| --- | --- | --- | --- | --- | --- |
| GLM 5.3 | glm-5.3-fp4 | 1M | $1.12 | $1.68 | $4.40 |
| GLM 5.3 Flash | glm-5.3-flash-fp4 | 1M | $0.15 | $0.23 | $0.50 |
| DeepSeek V4.1 Flash | deepseek-v4.1-flash-fast-fp4 | 1M | $0.30 | $0.09 | $1.20 |
Cached input tokens are always free; prompt tokens CoralBricks has not cached
yet bill once at the Cache Write rate, in place of the Input rate. Rates per
coralbricks.ai/pricing. The model-id type is open
(string & {}), so a newly launched model works before this package updates.
License
Apache-2.0
