Skip to content

快速开始

欢迎使用 Rai VIP,本文档将帮助你快速接入各种 AI 编程工具。

基础信息

项目
API Base URLhttps://raivip.com/v1
API Key在控制台获取,格式为 sk-xxxxxxxx
支持协议OpenAI API 兼容 / Anthropic API 兼容
支持模型GPT-4o、GPT-4.1、Claude Sonnet、Claude Opus、Gemini 等(以控制台为准)

提示

所有支持 OpenAI API 格式的工具,均可通过修改 Base URLAPI Key 来接入本中转站。

获取 API Key

  1. 访问 Rai VIP控制台
  2. 注册 / 登录账号
  3. 进入 API Key 管理 页面
  4. 点击 创建 API Key,复制生成的 Key

注意

请妥善保管你的 API Key,不要泄露到公开仓库或分享给他人。

验证连接

使用以下代码快速验证中转站是否可用:

bash
curl --location 'https://raivip.com/v1/chat/completions' \
  --header 'Authorization: Bearer sk-xxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": "你好,请用一句话介绍你自己"
      }
    ]
  }'
python
from openai import OpenAI

client = OpenAI(
    api_key="sk-xxxxxxxx",
    base_url="https://raivip.com/v1",
)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "你好,请用一句话介绍你自己"}],
)

print(response.choices[0].message.content)
go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body := map[string]any{
		"model": "gpt-4o-mini",
		"messages": []map[string]string{
			{"role": "user", "content": "你好,请用一句话介绍你自己"},
		},
	}
	data, _ := json.Marshal(body)
	req, _ := http.NewRequest("POST", "https://raivip.com/v1/chat/completions", bytes.NewReader(data))
	req.Header.Set("Authorization", "Bearer sk-xxxxxxxx")
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	fmt.Println("status:", resp.Status)
}
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String json = """
            {
              "model": "gpt-4o-mini",
              "messages": [{"role": "user", "content": "你好,请用一句话介绍你自己"}]
            }
            """;
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://raivip.com/v1/chat/completions"))
            .header("Authorization", "Bearer sk-xxxxxxxx")
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(json))
            .build();
        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode());
        System.out.println(response.body());
    }
}
csharp
using System.Net.Http;
using System.Text;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer sk-xxxxxxxx");
var json = """
{
  "model": "gpt-4o-mini",
  "messages": [{ "role": "user", "content": "你好,请用一句话介绍你自己" }]
}
""";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
    "https://raivip.com/v1/chat/completions",
    content
);
Console.WriteLine(await response.Content.ReadAsStringAsync());

如果返回正常的 JSON 响应,说明连接正常。

支持的工具一览

工具类型推荐指数
CursorAI 代码编辑器⭐⭐⭐⭐⭐
Claude Code命令行 AI 编程助手⭐⭐⭐⭐⭐
Codex CLI终端 AI 编程(OpenAI Codex)⭐⭐⭐⭐
ClineVS Code 插件⭐⭐⭐⭐
ContinueVS Code / JetBrains 插件⭐⭐⭐⭐
Aider终端 AI 编程助手⭐⭐⭐⭐
ChatBox跨平台对话客户端⭐⭐⭐
OpenAI APISDK 直接调用⭐⭐⭐⭐⭐
Gemini APIGemini 原生 REST 路径调用⭐⭐⭐⭐
WindsurfAI 代码编辑器⭐⭐⭐⭐
Cherry Studio桌面 AI 客户端⭐⭐⭐

选择你使用的工具,按照对应的配置指南进行设置即可。

Rai VIP API 文档