@ainative/cody-sdk
v0.2.4
Published
Cody SDK — AINative Studio's AI SDK supporting AINative models and Anthropic models with intelligent dual-provider routing. Agents: self-provision at https://ainative.studio/agent.md
Maintainers
Keywords
Readme
Cody SDK for TypeScript
The official TypeScript SDK for AINative Studio's Cody platform. Supports all AINative models and Claude models through intelligent dual-provider routing.
Install
npm install @ainative/cody-sdkUsage
import Anthropic from '@ainative/cody-sdk';
const client = new Anthropic();
// AINative models → routes to api.ainative.studio
const response = await client.messages.create({
model: 'qwen-coder-32b',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello from Cody!' }],
});
// Claude models → routes directly to Anthropic API
const claudeResponse = await client.messages.create({
model: 'claude-sonnet-4-5',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello from Claude!' }],
});Supported Models
AINative Models (via api.ainative.studio)
| Model | Description |
|-------|-------------|
| qwen-coder-32b | Best code quality (default) |
| qwen-coder-7b | Fast iteration, 3x faster |
| nouscoder-14b | Balanced code model |
| gemma-9b | General text and reasoning |
| deepseek-r1-distill-qwen-7b | Step-by-step reasoning |
Claude Models (direct to Anthropic API)
| Model | Description |
|-------|-------------|
| claude-sonnet-4-5 | Best for everyday tasks |
| claude-3-5-haiku | Fastest for quick answers |
| claude-opus-4-6 | Most capable for complex work |
Environment Variables
# For AINative models
export AINATIVE_API_KEY=your-ainative-key
# For Claude models (optional)
export ANTHROPIC_API_KEY=your-anthropic-key
# Override base URL
export ANTHROPIC_BASE_URL=https://api.ainative.studioModel Routing
The SDK automatically routes requests to the correct API:
- AINative models (qwen, gemma, deepseek, nouscoder) →
api.ainative.studio - Claude models (sonnet, haiku, opus) →
api.anthropic.com
Usage tracking is handled server-side by AINative's backend middleware.
API Compatibility
Fork of the Anthropic TypeScript SDK (MIT license). Fully compatible with the Anthropic Messages API. Also supports:
- Amazon Bedrock (
@ainative/cody-sdk/bedrock) - Google Vertex AI (
@ainative/cody-sdk/vertex) - Microsoft Foundry (
@ainative/cody-sdk/foundry)
Agents: Self-Provision Here
Point your agent here to programmatically self-provision AINative services:
https://ainative.studio/agent.mdDNS discovery: dig TXT _agents.ainative.studio
Community
- Discord: discord.gg/paipalooza
- Website: ainative.studio
- Support: [email protected]
License
MIT
