Documentation menu

Docs

Providers

NanoCodana never talks to a model API itself — you hand it an AI SDK model object, so anything the AI SDK supports works, and new providers work the day the AI SDK ships them.

import { anthropic } from '@ai-sdk/anthropic'           // anthropic('claude-sonnet-5')
import { openai } from '@ai-sdk/openai'                 // openai('gpt-5.1')
import { createOpenAICompatible } from '@ai-sdk/openai-compatible'

const router = createOpenAICompatible({ name: 'openrouter', baseURL: '…', apiKey: '…' })
const model = router('deepseek/deepseek-chat')

const agent = NodeAgent({ model, workingDirectory: process.cwd() })

OpenAI-compatible endpoints#

OpenRouter, DeepSeek, Together, Groq, xAI, Ollama, LM Studio, and most self-hosted stacks speak the OpenAI wire format — they all work through @ai-sdk/openai-compatible with a base URL. Local models via Ollama or LM Studio make a genuinely free, private coding agent.

Picking a coding model#

Agents lean hard on tool calling, so choose models that are strong at it. Frontier models (Claude Sonnet, GPT-4-class) are the reliable default; smaller models work for constrained tasks but expect more retries on complex multi-file edits.

Browser apps call the provider directly from the tab, so the provider must send CORS headers. Anthropic supports a browser-access opt-in header; many OpenAI-compatible endpoints do not — verify before building a frontend-only product around one.