3 分钟快速接入 Up and running in 3 minutes

3 分钟快速接入

Quickstart

这个页面的目标只有一个:让你从"了解"直接进入"可调用"。 One goal: take you from "reading docs" to "first successful API call."

1

在控制台生成令牌Create an API token

前往 api.llapi.net 登录后台,按以下步骤操作:

Go to api.llapi.net, log in, and follow these steps:

1
进入 令牌管理 Open Token Management
2
点击 添加令牌 Click Add Token
3
分组选择 default Set group to default
4
生成并复制你的 Key Generate and copy your Key
灵络API 后端基于 New API 搭建,令牌管理操作与标准 New API 面板一致。拿到 Key 之后,接下来就是标准的 OpenAI 兼容接入流程。 LingluoAPI is built on New API. Token management works exactly like a standard New API panel. Once you have the key, the rest is a standard OpenAI-compatible flow.
2

替换 baseURLapiKeySet baseURL and apiKey

如果你已经在用 OpenAI SDK,只需替换这两处:

If you already use the OpenAI SDK, change only these two values:

TypeScript
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:

bash
export LLAPI_API_KEY="your-token-here"

如果想长期生效:

To make it permanent:

bash
# zsh
echo 'export LLAPI_API_KEY="your-token"' >> ~/.zshrc && source ~/.zshrc

# bash
echo 'export LLAPI_API_KEY="your-token"' >> ~/.bashrc && source ~/.bashrc
3

发起第一个请求Make your first request

TypeScript
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)
核心就两件事: Two things to remember:
① 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:

按你的情况继续看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