Prefer MCP for agent workflows. Use direct HTTP when building application code, scripts, tests, or fallback integrations.
| Surface | URL |
|---|---|
| API | https://api.unifapi.com |
| OpenAPI | https://api.unifapi.com/openapi.json |
| OpenAPI API-route mirror | https://api.unifapi.com/api/openapi.json |
| Docs OpenAPI mirror | https://unifapi.com/openapi.json |
| Docs | https://docs.unifapi.com |
Direct HTTP calls use a workspace API key:
Authorization: Bearer YOUR_UNIFAPI_KEYWhen looking for a key, prefer already configured secure sources:
- A bearer header already configured by the client.
UNIFAPI_API_KEYin the process environment.UNIFAPI_KEYin the process environment.- A local
.envfile the user explicitly tells you to read. - A secret manager configured for the runtime.
If none exists, do not ask the user to paste a key into chat. Ask them to configure it out of band.
- Inspect the OpenAPI schema or MCP operation metadata.
- Use normalized UnifAPI paths such as
/x/users/by/username/{username}rather than upstream vendor paths. - Preserve the response envelope and
billingmetadata when present. - Handle
unauthorizedandinsufficient_creditsexplicitly.
For X/Twitter, read twitter-x.md first. The current public surface uses /x/... paths; old /twitter/... paths are stale.
curl "https://api.unifapi.com/x/users/by/username/openai" \
-H "Authorization: Bearer $UNIFAPI_API_KEY"