Grok Video Authenticated Result URL Design
Goal
Align the Grok video API documentation with the existing gateway behavior: a successful task returns a local, authenticated video proxy URL instead of a public provider-hosted MP4 URL.
Scope
- Update
docs/api文档/grok-视频-api配置.mdonly. - Keep the existing
POST /v1/video/generationsandGET /v1/video/generations/{task_id}workflow. - Do not change the API gateway, routes, response structures, models, or other documentation pages.
Public Contract
- A successful query returns
data.result_urlin the formhttps://api.constreet.cc/v1/videos/{task_id}/content. result_urlis an authenticated local proxy endpoint, not a public or temporary provider-hosted file URL.- Clients must send
Authorization: Bearer <YOUR_API_KEY>when downloading or streaming the video. - Opening
result_urldirectly without an authenticated browser session or an Authorization header can return HTTP 401. - The local proxy URL is not itself the temporary source link, but the source video resource is typically retained for about one hour. Clients should download or persist the video within one hour of task success.
- Raw provider response data and provider-hosted media URLs are not part of the documented public contract.
Documentation Changes
- Replace the successful response example's public MP4 URL with the local content proxy URL.
- Replace the unauthenticated curl download command with one that sends the API key.
- Replace statements that describe
result_urlitself as a temporary direct link. Clarify that the source resource behind the authenticated proxy is typically retained for about one hour and should be downloaded promptly. - Add a JavaScript helper that downloads the video through
result_urlwith the same Bearer token used for task creation and polling. - Add a troubleshooting row for HTTP 401 during video download.
- Repeat the authenticated-proxy requirement in the integration notes so it is not missed when examples are copied selectively.
Error Handling
- Task creation and polling errors retain their current handling.
- The JavaScript download helper checks
response.okand reports the HTTP status when content retrieval fails. - The documentation distinguishes task success from successful content download: a
SUCCESStask still requires an authenticated request to retrieve its video bytes.
Verification
- Run
npm run check:docsto validate documentation conventions. - Run
npm run buildto verify the MDX page compiles and the site builds. - Search the Grok page to confirm the one-hour retention note refers to the source resource rather than
result_urlitself. - Confirm every content-download example includes the Authorization header.