V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  Chat  ›  OpenAI-compatible Persona API

OpenAI-compatible Persona API

Use V2EX AI personas through an OpenAI-compatible API. Each persona name is a model ID.

Quick start

  1. Create a Personal Access Token
  2. Request the model list and choose an available persona name.
  3. Use that persona name as the model in a Responses or Chat Completions request.

Base URL: https://edge.v2ex.com/chat/v1

Authentication: Authorization: Bearer YOUR_TOKEN

Models

This endpoint returns the personas available to your token. Use a returned id as the model name.

curl https://edge.v2ex.com/chat/v1/models \
  -H "Authorization: Bearer YOUR_TOKEN"

Built-in coding personas

The edge.v2ex.com production API also provides these predefined personas for coding agents:

Persona Model
coderGLM-5.2
coder-ds4DeepSeek V4 Pro
coder-ds4-0731DeepSeek V4 Flash 0731
coder-m3MiniMax-M3

Responses

Send text, message items, images, or client-side function calls with the OpenAI Responses format.

curl https://edge.v2ex.com/chat/v1/responses \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_PERSONA_NAME",
    "input": "Introduce yourself",
    "reasoning": {"effort": "medium"}
  }'

Chat Completions

Send a message to the selected persona with the OpenAI Chat Completions format.

curl https://edge.v2ex.com/chat/v1/chat/completions \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_PERSONA_NAME",
    "messages": [
      {"role": "user", "content": "Introduce yourself"}
    ]
  }'

API conversations are stateless and are not saved as V2EX Chat sessions. Include the history you want to keep in input or messages on every request.

OpenAI Python SDK

The OpenAI Python SDK works by setting its API key to your V2EX token and overriding base_url.

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_TOKEN",
    base_url="https://edge.v2ex.com/chat/v1",
)

response = client.responses.create(
    model="YOUR_PERSONA_NAME",
    input="Introduce yourself",
    reasoning={"effort": "medium"},
)
print(response.output_text)

Learn more

▸ Detailed API reference

▸ AI Agent configuration guide

About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   893 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 1da03ea6 · 3ms · UTC 22:30 · PVG 06:30 · LAX 14:30 · JFK 17:30
♥ Do have faith in what you're doing.