Back to Blog
Blog

Why Your AI Stack Should Be Model-Agnostic

Cosmic AI's avatar

Cosmic AI

July 29, 2026

Updated October 9, 2026

The AI model landscape shifted three times in the last 90 days.

Claude Opus 5 shipped. Gemini 3.1 Pro dropped. Kimi K3 landed with competitive benchmark scores.

If your content infrastructure is wired to a single model, every one of those releases becomes a decision you have to make under pressure: migrate, stay, or fork the integration?

Model-agnostic infrastructure means you route to the best model for the job, swap when a better option ships, and your content layer stays stable throughout.

The problem with single-model lock-in

Most teams start with one model because it is the fastest path to shipping. You pick the best available option, wire it into your stack, and move on. That works fine until one of the following happens:

  • A better model ships at lower cost per token
  • Your chosen model has a reliability incident and you need to reroute fast
  • A task-specific model outperforms the general-purpose one you standardized on
  • Your provider changes pricing, deprecates a version, or shifts rate limits
  • Your team wants to benchmark models against each other before committing

None of these are edge cases. All of them happened in the last quarter.

When your content workflow is tightly coupled to one model string, any of those events becomes a migration project. When your content infrastructure is model-agnostic, it becomes a config change.

What model-agnostic looks like in practice

Cosmic's AI layer exposes one consistent API regardless of which model you route to underneath. Per the AI API reference, a single POST /v3/buckets/:bucket_slug/ai/text call accepts a model parameter, and the models documented there span four providers:

ProviderDocumented model IDs
Anthropicclaude-opus-5-5 (documented default, recommended), claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7, claude-sonnet-5, claude-sonnet-4-6, claude-haiku-4-5-20251001
Googlegemini-3.1-pro-preview
OpenAIgpt-5.5 (flagship), gpt-5.2-codex (coding), gpt-5-mini, gpt-5-nano
Moonshotkimi-k3 (2.8T-parameter MoE, 1M-token context)

Image generation routes the same way, with gemini-3.1-flash-image-preview as the documented default, plus gemini-3-pro-image-preview and dall-e-3.

The docs list additional models beyond the IDs above. Rather than reprint a model table here that goes stale in a fortnight, check the Available Models section of the AI API reference for the current list and cost tiers. That staleness is the whole argument: any hardcoded model inventory, in your docs or in your codebase, is a liability with a two-week shelf life.

Every model is reached through the same call. You change the model parameter. Nothing else in your integration changes.

Routing by task, not by habit

Model-agnostic infrastructure enables a pattern most teams do not have today: sending each task to the model best suited for it.

Here is a practical example using the Cosmic TypeScript SDK:

import { createBucketClient } from '@cosmicjs/sdk'; const cosmic = createBucketClient({ bucketSlug: 'your-bucket-slug', readKey: 'your-read-key', writeKey: 'your-write-key', }); // Default model: long-form drafting const draft = await cosmic.ai.generateText({ model: 'claude-opus-5-5', prompt: 'Draft a 1,200-word technical blog post on this topic: ' + brief, max_tokens: 2000, }); // Multimodal: image-aware alt text const altText = await cosmic.ai.generateText({ model: 'gemini-3.1-pro-preview', prompt: 'Write accessible alt text for this image', media_url: imageUrl, max_tokens: 100, }); // Code-adjacent content const snippet = await cosmic.ai.generateText({ model: 'gpt-5.2-codex', prompt: 'Write a TypeScript usage example for this endpoint: ' + endpointSpec, max_tokens: 600, }); console.log(draft.text, altText.text, snippet.text);

A bucket write key is required for all AI operations. The media_url parameter is not limited to images: the docs confirm it accepts any file type in your bucket, including PDFs, Excel spreadsheets, and Word documents, so document analysis routes through the same endpoint.

For anything user-facing, add stream: true and read the response as it generates, or use the shorthand:

const stream = await cosmic.ai.stream({ prompt: 'Summarize this release for the changelog', max_tokens: 500, }); for await (const chunk of stream) { if (chunk.text) process.stdout.write(chunk.text); }

The content layer, your Cosmic bucket, your object types, your structured data, stays identical across all of these calls. Only the model changes.

If you use Cursor or Claude Code as your primary editor, you can connect Cosmic to Cursor or Claude Code with MCP in about 10 minutes and have your agents managing content directly, whichever model you route to underneath.

Budget output tokens, not just model choice

Picking the cheaper model is the obvious lever. The larger one is usually output volume, especially once media generation enters a workflow.

Every plan ships with a monthly token allowance, and that allowance is what you are really budgeting against. Verified on the pricing page, read October 9, 2026:

PlanMonthly AI tokensAgentsWorkflows
Free, $0/mo300k in / 300k out11
Builder, $99/mo500k in / 500k out33
Team, $299/mo1M in / 1M out1010
Business, $499/mo3M in / 3M out2525

Generated media meters against that same output allocation, and the published costs are steep next to text:

GenerationOutput tokens
DALL-E 3 image4,800
Gemini image, 1K or 2K32,160
Gemini image, 4K57,600
Video, 4s96,000
Video, 6s144,000
Video, 8s192,000
Video extension, 8s192,000
TTS audio, per 1K characters3,600
TTS HD audio, per 1K characters7,200

Note that these media figures changed between September 28 and October 9, 2026. The docs previously published separate Veo Fast and Veo Standard video tiers topping out at 768,000 output tokens for an eight-second clip. The current reference lists a single video model, gemini-omni-1.1-flash, priced by duration, and an eight-second clip now costs 192,000 output tokens. That is a useful illustration of the argument in this post: the media cost table under your content tooling can be rewritten without warning, so build around a routing layer instead of around one model's price sheet.

The spread is still the point. One 8-second video costs the same as 40 DALL-E 3 images, and a single 4K Gemini image costs twelve times a DALL-E 3 one. Media generation is what empties a token budget.

Put those two tables next to each other and the sizing becomes clear. A single eight-second video costs 192,000 output tokens, which is about 64% of the Free plan's entire monthly output allowance and 38% of Builder's. Three of them exceed Builder's monthly output allowance outright. Text drafting will rarely blow your budget. A video step wired into a scheduled workflow can do it in a handful of runs.

Tier multipliers decide how fast you burn tokens

Text generation does not deduct tokens one for one. The AI API reference, read October 9, 2026, applies a tier multiplier to your actual usage:

TierMultiplierModels the docs list
Budget1.0xGPT-5 Nano, GPT-5 Mini, Claude Haiku 4.5
Standard2.0xGPT-5, GPT-5.2, GPT-5.2 Codex, GPT-5.5, Claude Sonnet 4.6, Claude Sonnet 5, Claude Opus 4.7, Claude Opus 4.8, Gemini 3.1 Pro, Kimi K3
Premium4.0xClaude Fable 5

One gap worth knowing before you budget: as read on October 9, 2026, the multiplier table still does not list claude-opus-5 or claude-opus-5-5, even though claude-opus-5-5 is the documented default for the text endpoint. If you are sizing spend around the default, confirm its tier rather than assuming it bills like Opus 4.8.

A 1,000-token response from a Standard-tier model deducts 2,000 tokens from your monthly allowance. The same response from a Budget-tier model deducts 1,000. That is a 2x swing on identical work, and 4x between Budget and Premium.

This is the sharpest practical argument for routing by task. Alt text, tags, slugs, and short summaries rarely need a frontier model, and moving that volume down a tier cuts what it costs against your allowance by half or more. The only thing that changes in your code is the model string. Tier assignments shift as models are added, so check the Available Models section before you standardize on one.

When you need more headroom, token packs top you up as one-time purchases: $25 for 2M tokens, $110 for 10M, and $475 for 50M, which works out to the lowest published rate of $9.50 per million. Recurring token add-ons are priced separately at $5 per million input tokens and $19 per million output tokens per month. Packs work with any model, and they count both input and output.

One detail worth knowing before you plan capacity: if you are running several projects, a Workspace pools Buckets, Objects, and usage across all of them and bills once.

Why this matters more now than it did six months ago

The release cadence has accelerated. Cosmic's own text endpoint now documents models from Anthropic, Google, OpenAI, and Moonshot, and its documented default has already moved twice, from claude-opus-5 to claude-opus-5-5. Defaults shift because the frontier shifts.

Teams wired to a single model are making an implicit bet that their model stays best-in-class. That bet has not held for any model over a sustained period.

The practical implication: content infrastructure and AI model selection are separate concerns that should be managed separately. Your CMS should not force you to pick one and stay there.

What to do today

  1. Audit your model usage. Are you defaulting to one model everywhere because that is where you started, or because it is genuinely the best choice for each task? Those are different answers.

  2. Route by cost and capability. Send high-volume, low-complexity work (metadata, tags, alt text, short summaries) to the cheapest model that clears your quality bar. Reserve the expensive calls for drafting and reasoning, where output quality moves the outcome.

  3. Extract the model string to config. If your agent or pipeline hardcodes a model, pull it into a variable today. The next release is roughly two weeks out.

  4. Meter your media steps. Video and audio generation dominate output token spend. Check the cost against your plan's allowance before it lands in a scheduled workflow.

Start building

Every model above runs against the same content layer, so switching is a config change rather than a migration. The full model list and endpoint reference lives in the AI API reference, and you can see how the pieces fit together on the Cosmic AI overview.

Start free on the Free plan (1 Bucket, 2 team members, 1,000 Objects, 300k in / 300k out AI tokens, $0/month), or book a 20-minute walkthrough with Tony if you want to talk through routing strategy for a specific workflow. Paid plans start at $99/month for Builder, with Team at $299/month and Business at $499/month. Additional team members are $29/user/month.


Last verified: October 9, 2026. Sources checked in this pass: Cosmic AI API reference for model IDs, the claude-opus-5-5 default, cost-tier multipliers, streaming, media_url file support, and media generation token costs; and Cosmic pricing for plan pricing, monthly AI token allowances, per-plan agent and workflow counts, token pack rates, and per-seat cost. Two things moved since the September 28 pass. Three Anthropic models were added to the documented list: claude-opus-4-8, claude-opus-4-7, and claude-sonnet-4-6. The media generation cost table was replaced outright: the separate Veo Fast and Veo Standard video tiers are gone, and video is now priced by duration at 96,000 output tokens for 4 seconds, 144,000 for 6 seconds, and 192,000 for 8 seconds. Plan pricing, monthly token allowances, agent and workflow counts, and token pack rates were unchanged.

Learn how to build this in Cosmic

The Learn Cosmic hub has step-by-step lessons on building agentic workflows, connecting AI tools to your content layer, and shipping sites with Next.js, Astro, and more.

Browse all lessons →

Give your AI agents a content backend they can write to

Structured, versioned content objects, a REST API and TypeScript SDK, and an MCP server your coding agent connects to directly. The Free plan includes 1 Bucket, 1,000 Objects, and 1 agent. No credit card required.