Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AICP JavaScript SDK

The official JavaScript / TypeScript SDK for AI Inference Control Plane — a provider-agnostic LLM gateway that lets you route, monitor, and control inference requests across OpenAI, Anthropic, Google, and more.

Installation

npm install @aicp/sdk
# or
yarn add @aicp/sdk
# or
pnpm add @aicp/sdk

Requires Node.js 18+ (uses native fetch). Works in modern browsers too.

Quick start

import { AICPClient } from '@aicp/sdk';

const client = new AICPClient({
  apiKey: 'aicp-...',
  baseUrl: 'https://your-aicp-gateway',
});

const response = await client.chat.complete({
  model: 'gpt-4o-mini',
  messages: [{ role: 'user', content: 'Hello!' }],
});

console.log(response.choices[0].message.content);

Streaming

for await (const chunk of client.chat.stream({
  model: 'claude-3-5-haiku-20241022',
  messages: [{ role: 'user', content: 'Tell me a story' }],
})) {
  process.stdout.write(chunk);
}

Authentication

const { token } = await client.auth.login({ email, password });
client.setApiKey(token);

Documentation

Full SDK documentation: aicp.dev/docs

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages