neoncodex-sdk
v1.0.0
Published
Official JavaScript/TypeScript SDK for NeonCodex AI
Maintainers
Readme
@neoncodex/sdk
Official JavaScript/TypeScript SDK for NeonCodex AI — Claude 4.6, GPT-5.5, Gemini 3.1 Pro, and 50+ models in one API.
Install
npm install @neoncodex/sdkQuick start
import NeonCodex from '@neoncodex/sdk';
const client = new NeonCodex({ apiKey: 'nck_live_...' });
// Run a task and get the full output
const output = await client.tasks.run({
prompt: 'Write a Python function to parse CSV files',
model: 'auto', // auto-routes to the best model
});
console.log(output);
// Stream output in real time
for await (const chunk of client.tasks.stream({ prompt: 'Explain async/await' })) {
process.stdout.write(chunk);
}Models
| Model | ID |
|---|---|
| Auto routing | auto |
| Claude Sonnet 4.6 | claude-sonnet-4-6 |
| Claude Opus 4.6 | claude-opus-4-6 |
| GPT-5.5 | gpt-5.5 |
| Gemini 3.1 Pro | google/gemini-3.1-pro-preview |
| DeepSeek V4 Pro | deepseek/deepseek-v4-pro |
| Qwen3 Coder (free) | qwen/qwen3-coder:free |
| Nemotron Super 120B (free) | nvidia/nemotron-3-super-120b-a12b:free |
API Reference
client.tasks.run(opts) → Promise<string>
Create a task and wait for the full output.
client.tasks.stream(opts) → AsyncGenerator<string>
Create a task and stream output chunks.
client.tasks.create(opts) → Promise<Task>
Create a task without waiting (returns immediately with task ID).
client.tasks.get(taskId) → Promise<Task>
Get task status and output by ID.
client.tasks.wait(taskId) → Promise<Task>
Poll until a task completes.
client.tasks.list(limit?) → Promise<Task[]>
List recent tasks.
client.tasks.cancel(taskId) → Promise<void>
Cancel a running task.
client.files.upload(filename, content) → Promise<Attachment>
Create an attachment from a string or Buffer.
client.me() → Promise<User>
Get the current authenticated user.
File attachments
const attachment = await client.files.upload('data.csv', csvContent);
const output = await client.tasks.run({
prompt: 'Analyze this CSV and find trends',
attachments: [attachment],
});Error handling
import NeonCodex, { NeonCodexError } from '@neoncodex/sdk';
try {
const output = await client.tasks.run({ prompt: '...' });
} catch (err) {
if (err instanceof NeonCodexError) {
console.error(err.message, err.statusCode);
}
}Get an API key
Sign up at neoncodex.io → Settings → API Keys.
License
MIT
