paxs-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePAXS AI Platform Integration
PAXS AI平台集成
You help users connect to and use the PAXS AI platform for transcription, meeting notes, and meeting management.
您可以帮助用户连接并使用PAXS AI平台进行转录、会议纪要生成和会议管理。
Authentication
认证
PAXS uses OAuth2 with Google login. Before calling any API, check if the user has a valid access token.
PAXS采用基于Google登录的OAuth2认证方式。在调用任何API之前,请检查用户是否拥有有效的访问令牌。
If No Token Exists
无可用令牌时
- Generate a state parameter: a random string for CSRF protection
- Present the user with an authorization link:
https://dzd.paxs.ai/api/oauth/provider/authorize?redirect_uri={CALLBACK_URL}&response_type=code&state={STATE}- After the user clicks and authorizes, they will be redirected to the callback URL with
?code=xxx&state=xxx - Exchange the code for tokens:
POST https://dzd.paxs.ai/api/oauth/provider/token
Content-Type: application/json
{
"grant_type": "authorization_code",
"code": "<CODE>",
"redirect_uri": "<CALLBACK_URL>"
}Response:
json
{
"access_token": "...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "...",
"scope": "session media analysis user:read"
}- Store the tokens in :
.claude/skills/paxs-api/.tokens.json
json
{
"access_token": "...",
"refresh_token": "..."
}- 生成state参数:一个用于CSRF保护的随机字符串
- 向用户展示授权链接:
https://dzd.paxs.ai/api/oauth/provider/authorize?redirect_uri={CALLBACK_URL}&response_type=code&state={STATE}- 用户点击并授权后,将被重定向至回调URL,携带参数
?code=xxx&state=xxx - 用授权码换取令牌:
POST https://dzd.paxs.ai/api/oauth/provider/token
Content-Type: application/json
{
"grant_type": "authorization_code",
"code": "<CODE>",
"redirect_uri": "<CALLBACK_URL>"
}响应:
json
{
"access_token": "...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "...",
"scope": "session media analysis user:read"
}- 将令牌存储在中:
.claude/skills/paxs-api/.tokens.json
json
{
"access_token": "...",
"refresh_token": "..."
}Token Storage
令牌存储
- Tokens are stored at
.claude/skills/paxs-api/.tokens.json - Always read tokens from this file before making API calls
- After obtaining or refreshing tokens, update this file immediately
- 令牌存储在中
.claude/skills/paxs-api/.tokens.json - 调用API前务必从此文件读取令牌
- 获取或刷新令牌后,立即更新此文件
If Token Expired (401 Response)
令牌过期时(返回401响应)
Refresh the token:
POST https://dzd.paxs.ai/api/oauth/provider/token
Content-Type: application/json
{
"grant_type": "refresh_token",
"refresh_token": "<REFRESH_TOKEN>"
}The response returns new access_token and refresh_token. Always store the latest tokens.
刷新令牌:
POST https://dzd.paxs.ai/api/oauth/provider/token
Content-Type: application/json
{
"grant_type": "refresh_token",
"refresh_token": "<REFRESH_TOKEN>"
}响应将返回新的access_token和refresh_token。请始终存储最新的令牌。
Token Lifetime
令牌有效期
- Access token: 1 hour
- Refresh token: 30 days
- 访问令牌:1小时
- 刷新令牌:30天
Supported File Formats
支持的文件格式
Audio: MP3, WAV, FLAC, MPA, AAC, Opus, M4A
Video: MPEG, MP4, FLV, WebM, WMV, 3GP
Before uploading, validate the file extension. Reject unsupported formats with a clear error message listing the accepted formats above.
音频: MP3, WAV, FLAC, MPA, AAC, Opus, M4A
视频: MPEG, MP4, FLV, WebM, WMV, 3GP
上传前请验证文件扩展名。若格式不支持,需清晰告知用户并列出上述支持的格式。
API Reference
API参考
All API calls require the header:
Authorization: Bearer <ACCESS_TOKEN>Base URL: (hardcoded for local development)
https://dzd.paxs.ai所有API调用均需携带请求头:
Authorization: Bearer <ACCESS_TOKEN>基础URL:(本地开发时为硬编码)
https://dzd.paxs.aiGet Current User
获取当前用户信息
GET /api/users/meUse this to verify the token works and get the user's profile.
GET /api/users/me用于验证令牌有效性并获取用户资料。
Create a Meeting
创建会议
POST /api/sessions
Content-Type: application/json
{
"title": "Meeting title",
"description": "Optional description",
"attendees": [
{"email": "user@example.com", "displayName": "User Name", "role": "participant", "source": "manual"},
{"email": "other@example.com", "displayName": "Other Person", "role": "participant", "source": "manual"}
]
}Attendee fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | — | Attendee email (cannot be empty) |
| string | Yes | — | Attendee display name (cannot be empty) |
| string | No | | Attendee role |
| string | No | | Source: |
Important: is required when creating a meeting. The user must provide at least the attendee list. If the user does not provide attendees, ask them before proceeding.
attendeesReturns the created meeting with an .
idPOST /api/sessions
Content-Type: application/json
{
"title": "Meeting title",
"description": "Optional description",
"attendees": [
{"email": "user@example.com", "displayName": "User Name", "role": "participant", "source": "manual"},
{"email": "other@example.com", "displayName": "Other Person", "role": "participant", "source": "manual"}
]
}参会者字段说明:
| 字段 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| 字符串 | 是 | — | 参会者邮箱(不能为空) |
| 字符串 | 是 | — | 参会者显示名称(不能为空) |
| 字符串 | 否 | | 参会者角色 |
| 字符串 | 否 | | 来源: |
重要提示: 创建会议时必须提供参数。用户至少需提供参会者列表。若用户未提供,需先询问用户。
attendees返回已创建的会议及其。
idUpload a Recording
上传录制文件
POST /api/recordings?session_id={SESSION_ID}
Content-Type: multipart/form-data
file: <audio/video file>Returns the attachment with an .
idImportant: The must be sent as a form field (not a query parameter).
session_idConstraints:
- One recording per meeting — Each meeting can only have one active recording. Uploading a new recording replaces the existing one.
- Auto-pipeline — After a successful upload, the backend automatically triggers the full analysis pipeline: transcription first, then meeting note upon transcription completion. No manual analysis request is needed.
- MIME type required — When uploading via curl, specify the correct MIME type (e.g., ). Without it, the server rejects the file.
file=@recording.wav;type=audio/wav - If the user provides multiple audio files, create a separate meeting for each file.
POST /api/recordings?session_id={SESSION_ID}
Content-Type: multipart/form-data
file: <audio/video file>返回附件及其。
id重要提示: 必须作为表单字段发送(而非查询参数)。
session_id约束条件:
- 每个会议仅支持一个录制文件 — 每个会议只能有一个有效录制文件。上传新文件将替换现有文件。
- 自动流水线 — 上传成功后,后端将自动触发完整分析流程:先转录,转录完成后生成会议纪要。无需手动发起分析请求。
- 需指定MIME类型 — 使用curl上传时,需指定正确的MIME类型(例如)。若未指定,服务器将拒绝接收文件。
file=@recording.wav;type=audio/wav - 若用户提供多个音频文件,需为每个文件创建单独的会议。
Request Analysis
请求分析
POST /api/analysis/request
Content-Type: application/json
{
"session_id": "<SESSION_ID>",
"attachment_id": "<ATTACHMENT_ID>",
"analysis_types": ["transcription", "meeting note"],
"instruction": "Generate a detailed meeting summary",
"meeting_type": "group"
}Available analysis types:
- — Speech-to-text
transcription - — Meeting summary (requires
meeting note)instruction - — Extract key discussion points
key_points - — Sentiment analysis
sentiment
Meeting types: , , , , ,
groupteamdepartmentcross_functionalorganizationcompanyNote: If requesting , the field is required.
meeting noteinstructionDependency handling: The backend automatically resolves dependencies between analysis types. For example, passing in a single request will automatically complete transcription first, then generate the meeting note. No need to make separate requests or wait between them.
["transcription", "meeting note"]POST /api/analysis/request
Content-Type: application/json
{
"session_id": "<SESSION_ID>",
"attachment_id": "<ATTACHMENT_ID>",
"analysis_types": ["transcription", "meeting note"],
"instruction": "Generate a detailed meeting summary",
"meeting_type": "group"
}支持的分析类型:
- — 语音转文字
transcription - — 会议纪要(需提供
meeting note参数)instruction - — 提取关键讨论要点
key_points - — 情感分析
sentiment
会议类型:、、、、、
groupteamdepartmentcross_functionalorganizationcompany注意:若请求,则字段为必填项。
meeting noteinstruction依赖处理:后端会自动处理分析类型之间的依赖关系。例如,若传入,系统会自动先完成转录,再生成会议纪要。无需分开请求或等待。
["transcription", "meeting note"]Get Recording Analysis
获取录制文件分析结果
GET /api/recordings/{RECORDING_ID}/analysis?session_id={SESSION_ID}Returns all analysis reports for a recording. Each report has a field:
status- — Not yet started
pending - — In progress
processing - — Done, results available
completed - — Analysis failed
failed
Optional query parameters:
- — Filter by specific type (e.g.,
analysis_type,transcription)meeting note
GET /api/recordings/{RECORDING_ID}/analysis?session_id={SESSION_ID}返回录制文件的所有分析报告。每个报告包含字段:
status- — 尚未开始
pending - — 处理中
processing - — 已完成,结果可用
completed - — 分析失败
failed
可选查询参数:
- — 按特定类型筛选(例如
analysis_type、transcription)meeting note
Polling Strategy
轮询策略
Analysis is asynchronous. After uploading a recording, poll this endpoint:
- Wait 5 seconds before the first poll
- Poll every 5 seconds:
GET /api/recordings/{RECORDING_ID}/analysis?session_id={SESSION_ID} - Check the of each analysis type in the response
status - Stop when transcription status is or
completedfailed - Timeout after 5 minutes (60 polls)
分析为异步流程。上传录制文件后,需轮询此端点:
- 首次轮询前等待5秒
- 每5秒轮询一次:
GET /api/recordings/{RECORDING_ID}/analysis?session_id={SESSION_ID} - 检查响应中各分析类型的
status - 当转录状态为或
completed时停止轮询failed - 超时时间为5分钟(共60次轮询)
List meeting
列出会议
GET /api/sessions?page=1&page_size=20GET /api/sessions?page=1&page_size=20Get meeting Details
获取会议详情
GET /api/sessions/{SESSION_ID}GET /api/sessions/{SESSION_ID}One-Shot Mode
单次处理模式
When a user provides audio file(s), automatically handle the entire pipeline. The user must provide:
- Audio file(s) — local path or URL
- Attendees — list of participants with at least and
emaildisplayName
If attendees are not provided, ask the user before proceeding.
当用户提供音频文件时,自动处理完整流程。用户需提供:
- 音频文件 — 本地路径或URL
- 参会者 — 包含至少和
email的参会者列表displayName
若未提供参会者,需先询问用户。
Single File
单个文件
- Validate file format (must be a supported audio/video format)
- Load tokens from (run OAuth if missing)
.claude/skills/paxs-api/.tokens.json - Create a meeting with the filename as title and the provided attendees
- Upload the recording (backend auto-triggers transcription → meeting note pipeline)
- Poll analysis status every 5 seconds via
GET /api/recordings/{RECORDING_ID}/analysis?session_id={SESSION_ID} - If transcription fails, retry upload up to 3 times. After 3 failures, notify the user.
- Once completed, return the results to the user
- 验证文件格式(必须为支持的音频/视频格式)
- 从加载令牌(若缺失则执行OAuth流程)
.claude/skills/paxs-api/.tokens.json - 以文件名作为标题,结合提供的参会者创建会议
- 上传录制文件(后端自动触发转录→会议纪要流程)
- 每5秒通过轮询分析状态
GET /api/recordings/{RECORDING_ID}/analysis?session_id={SESSION_ID} - 若转录失败,最多重试上传3次。3次失败后通知用户。
- 完成后将结果返回给用户
Multiple Files
多个文件
Each file gets its own meeting (one recording per meeting). Process sequentially:
- Validate all file formats first — reject any unsupported files before starting
- For each file, repeat the single file flow (steps 2-7)
- Present results grouped by file
每个文件对应一个独立会议(每个会议一个录制文件)。按顺序处理:
- 先验证所有文件格式 — 开始处理前拒绝任何不支持的文件
- 对每个文件重复单个文件的处理流程(步骤2-7)
- 按文件分组展示结果
Workflow
工作流程
When a user wants to transcribe or analyze a meeting recording:
- Load tokens — Read for stored credentials
.claude/skills/paxs-api/.tokens.json - Authenticate — If no tokens, run the OAuth flow via ; if token expired (401), refresh it
oauth_callback_server.py - Collect inputs — Ensure the user has provided: audio file + attendees list (ask if missing)
- Validate file — Check the file extension is a supported format before proceeding
- Create meeting — with title and attendees (attendees required)
POST /api/sessions - Upload recording — with the audio file as multipart form data (include
POST /api/recordingsas form field and correct MIME type)session_id - Monitor — The backend auto-triggers: transcription → meeting note. Poll via every 5 seconds.
GET /api/recordings/{RECORDING_ID}/analysis?session_id={SESSION_ID} - Retry on failure — If transcription fails, retry the upload (max 3 attempts). After 3 failures, notify the user with the error details.
当用户需要转录或分析会议录制文件时:
- 加载令牌 — 读取中的存储凭证
.claude/skills/paxs-api/.tokens.json - 认证 — 若无令牌,通过执行OAuth流程;若令牌过期(返回401),则刷新令牌
oauth_callback_server.py - 收集输入 — 确保用户已提供:音频文件+参会者列表(若缺失则询问)
- 验证文件 — 继续前检查文件扩展名是否为支持的格式
- 创建会议 — 调用接口,传入标题和参会者(参会者为必填项)
POST /api/sessions - 上传录制文件 — 调用接口,以multipart表单数据形式上传音频文件(需将
POST /api/recordings作为表单字段,并指定正确的MIME类型)session_id - 监控状态 — 后端自动触发:转录→会议纪要流程。每5秒通过轮询状态
GET /api/recordings/{RECORDING_ID}/analysis?session_id={SESSION_ID} - 失败重试 — 若转录失败,最多重试上传3次后向用户通知错误详情。
Error Handling
错误处理
- → Token expired, refresh it
401 Unauthorized - → Insufficient scope or permissions
403 Forbidden - → Check request parameters
400 Bad Request - → Resource does not exist
404 Not Found
- → 令牌过期,需刷新令牌
401 Unauthorized - → 权限或作用域不足
403 Forbidden - → 检查请求参数
400 Bad Request - → 资源不存在
404 Not Found
Guidelines
注意事项
- Always read tokens from before making API calls
.claude/skills/paxs-api/.tokens.json - When the token expires (401), automatically refresh, update , and retry
.tokens.json - Present the authorization link clearly and explain what it does
- Always require attendees when creating a meeting — ask the user if not provided
- After uploading a recording, the backend handles the full pipeline automatically (transcription → meeting note)
- Do not manually call in the standard flow — only use it for on-demand analysis types like
/api/analysis/requestorkey_pointssentiment - Poll every 5 seconds until completed (max 5 minutes)
- On transcription failure, retry upload up to 3 times before notifying the user
- When uploading via curl, always include the correct MIME type for the file
- 调用API前务必从读取令牌
.claude/skills/paxs-api/.tokens.json - 令牌过期时(返回401),自动刷新令牌、更新并重试请求
.tokens.json - 清晰展示授权链接并说明其用途
- 创建会议时必须要求用户提供参会者列表 — 若缺失需询问用户
- 上传录制文件后,后端将自动处理完整流程(转录→会议纪要)
- 标准流程中请勿手动调用接口 — 仅需在按需分析
/api/analysis/request或key_points等类型时使用sentiment - 每5秒轮询一次状态,直至完成(最长等待5分钟)
- 转录失败时,最多重试上传3次后通知用户
- 使用curl上传时,务必为文件指定正确的MIME类型