3 分钟快速接入
Quickstart
这个页面的目标只有一个:让你从"了解"直接进入"可调用"。 One goal: take you from "reading docs" to "first successful API call."
在控制台生成令牌Create an API token
前往 api.llapi.net 登录后台,按以下步骤操作:
Go to api.llapi.net, log in, and follow these steps:
令牌管理
Open Token Management
添加令牌
Click Add Token
default
Set group to default
替换 baseURL 和 apiKeySet baseURL and apiKey
如果你已经在用 OpenAI SDK,只需替换这两处:
If you already use the OpenAI SDK, change only these two values:
import OpenAI from 'openai'
const client = new OpenAI({
apiKey: process.env.LLAPI_API_KEY,
baseURL: 'https://api.llapi.net/v1'
})
如果还没设置环境变量,可以先临时导出:
If you haven't set the environment variable yet, export it temporarily:
export LLAPI_API_KEY="your-token-here"
如果想长期生效:
To make it permanent:
# zsh
echo 'export LLAPI_API_KEY="your-token"' >> ~/.zshrc && source ~/.zshrc
# bash
echo 'export LLAPI_API_KEY="your-token"' >> ~/.bashrc && source ~/.bashrc
发起第一个请求Make your first request
const completion = await client.chat.completions.create({
model: 'claude-sonnet',
messages: [
{ role: 'system', content: 'You are a concise engineering assistant.' },
{ role: 'user', content: 'Give me a deployment checklist.' }
]
})
console.log(completion.choices[0]?.message?.content)
① URL →
https://api.llapi.net/v1② Key → 你在令牌管理里生成的令牌
其余:请求结构、SDK 用法、消息格式,保持原来写法不变。 ① URL →
https://api.llapi.net/v1② Key → the token from Token Management
Everything else — request structure, SDK calls, message format — stays the same.
接下来可以看什么What to read next
如果你已经把第一个请求跑通,下面这些页面可以帮你把接入链路补完整:
First request working? Here's how to deepen your integration:
OpenAI 兼容接入Proxy Guide
了解为什么现有 OpenAI SDK 基本不用大改,以及统一入口的架构思路。Understand why your existing OpenAI SDK works with minimal changes, and the architecture behind it.
Claude 兼容接入Proxy Guide
如果你主要在用 Claude Code 或需要调用 Claude 系列模型,可以从这里开始。If you're using Claude Code or primarily calling Claude models, start here.
FAQ
常见问题,包括兼容性、模型切换、SDK 用法等。Common questions about compatibility, model switching, SDK usage, and more.
按你的情况继续看By your use case
| 你的情况Your situation | 下一步Next step |
|---|---|
| 已经准备好试用Ready to dive in | 返回控制台,创建更多 Key 或查看套餐Back to console — create more keys or view plans |
| 想确认 SDK 兼容性Need to verify SDK compatibility | 阅读 OpenAI 兼容接入Read OpenAI Proxy Guide |
| 主要在用 Claude / Claude CodeUsing Claude or Claude Code | 阅读 Claude 兼容接入Read Claude Proxy Guide |
| 还有其他疑问Have other questions | 阅读 FAQRead FAQ |