Skip to main content

Official SDKs

ARouter provides first-party SDKs with full support for chat completions, streaming, key management, and provider proxy.

Go SDK

The official Go SDK for ARouter. Lightweight, zero-dependency, and idiomatic Go.
Packagegithub.com/arouter-ai/arouter-go
StatusStable
Min Go Version1.21+
LicenseMIT
SourceGitHub

Features

  • Chat completions (single and streaming)
  • Multi-provider model routing
  • Key management (create, list, update, delete)
  • Provider proxy for raw upstream access
  • Structured error handling with sentinel errors
  • Configurable timeouts and custom HTTP clients

Install

go get github.com/arouter-ai/arouter-go

Quick Example

import arouter "github.com/arouter-ai/arouter-go"

client := arouter.NewClient("https://api.arouter.com", "lr_live_xxxx")

resp, err := client.ChatCompletion(ctx, arouter.ChatCompletionRequest{
    Model:    "gpt-4o",
    Messages: []arouter.Message{{Role: "user", Content: "Hello!"}},
})

Full Go SDK Documentation

See complete API reference, streaming examples, key management, and error handling.

Node.js SDK (Preview)

TypeScript-first SDK with chat completions, streaming, key management, and usage tracking.
Package@arouter/sdk
StatusPreview (v0.1.0)
RuntimeNode.js 18+
LicenseMIT
SourceGitHub

Features

  • Chat completions (single and streaming)
  • Full TypeScript type definitions
  • Key management
  • Usage tracking and analytics
  • Provider proxy support

Install

npm install @arouter/sdk

Quick Example

import { ARouter } from "@arouter/sdk";

const router = new ARouter({
  apiKey: "lr_live_xxxx",
  baseURL: "https://api.arouter.com",
});

const response = await router.chatCompletion({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello!" }],
});

Full Node.js SDK Documentation

See complete API reference including OpenAI/Anthropic SDK compatibility guides.

Third-Party SDK Compatibility

You don’t need an ARouter SDK to get started. ARouter is fully compatible with existing provider SDKs:
SDKLanguageInstallDocs
OpenAI SDKPythonpip install openaiGuide →
OpenAI SDKNode.jsnpm install openaiGuide →
Anthropic SDKPythonpip install anthropicGuide →
Anthropic SDKNode.jsnpm install @anthropic-ai/sdkGuide →
Gemini SDKPythonpip install google-generativeaiGuide →
cURLAnyBuilt-inGuide →
Just change base_url to https://api.arouter.com and set your ARouter API key — all existing SDK code works without modification.