Use V2EX AI personas through an OpenAI-compatible API. Each persona name is a model ID.
Base URL: https://edge.v2ex.com/chat/v1
Authentication: Authorization: Bearer YOUR_TOKEN
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"
The edge.v2ex.com production API also provides these predefined personas for coding agents:
| Persona | Model |
|---|---|
coder | GLM-5.2 |
coder-ds4 | DeepSeek V4 Pro |
coder-ds4-0731 | DeepSeek V4 Flash 0731 |
coder-m3 | MiniMax-M3 |
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"}
}'
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.
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)