Authentication
📝 TODO — this English page is a skeleton. The structure mirrors the Chinese page, which is fully written.
ModelFold has two independent credential systems:
| Caller | Used on | Credential | Header |
|---|---|---|---|
| Your backend | /v1 gateway | API key (mf- prefix) | Authorization: Bearer mf-... |
| Console frontend | /api/* | Session token (JWT) | Authorization: Bearer <token> |
Calling models only requires an API key.
Using an API key
bash
curl -X POST "https://ai.modelfold.online/v1/chat/completions" \
-H "Authorization: Bearer mf-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"hello"}]}'Key lifecycle
| Action | Endpoint |
|---|---|
| List | GET /api/keys |
| Create | POST /api/keys |
| Revoke | DELETE /api/keys/:id |
Failure modes
| HTTP | error.type | Cause |
|---|---|---|
401 | unauthorized | Missing, malformed or revoked key |
402 | insufficient_credits | Balance too low; the upstream is never called |
429 | rate_limited | Over 60 requests per key per minute |