Quickstart

Get started with the Aiproxy control plane in under 10 minutes.

1. Create an account

Sign up for a free account at dashboard. No credit card required.

2. Connect a provider to your workspace runtime

Aiproxy provisions a CLIProxyAPIPlus-backed runtime for your workspace, then lets you connect providers through the dashboard.

3. Generate an Aiproxy tenant API key

Create a tenant API key that routes into your workspace runtime.

4. Make your first request

Use the OpenAI SDK with your Aiproxy key after provider onboarding is complete:

import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: process.env.AIPROXY_KEY,
  baseURL: 'https://YOUR_DOMAIN/api/proxy'
})

const response = await client.chat.completions.create({
  model: 'gpt-4',
  messages: [
    { role: 'user', content: 'Hello, world!' }
  ]
})

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

Authentication

Aiproxy uses API keys for authentication. Include your key in the Authorization header:

Authorization: Bearer YOUR_AIPROXY_KEY

Supported Providers

Aiproxy inherits provider breadth from CLIProxyAPIPlus. The control plane manages onboarding, entitlement, and runtime state for those providers.

OpenAI

Provider connection is managed through your workspace runtime and surfaced through the Aiproxy control plane.

Anthropic

Provider connection is managed through your workspace runtime and surfaced through the Aiproxy control plane.

Google AI

Provider connection is managed through your workspace runtime and surfaced through the Aiproxy control plane.

Cohere

Provider connection is managed through your workspace runtime and surfaced through the Aiproxy control plane.

Examples

Streaming responses

const stream = await client.chat.completions.create({
  model: 'gpt-4',
  messages: [{ role: 'user', content: 'Tell me a story' }],
  stream: true
})

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content || '')
}

Error handling

try {
  const response = await client.chat.completions.create({
    model: 'gpt-4',
    messages: [{ role: 'user', content: 'Hello!' }]
  })
} catch (error) {
  if (error.status === 429) {
    console.error('Rate limit exceeded')
  } else {
    console.error('API error:', error.message)
  }
}