Spaces:
Sleeping
Sleeping
|
Download docs/md/design/application/rest_api_swagger.md from thanhnv2323/humanize-text-python: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/thanhnv2323/humanize-text-python/resolve/main/docs/md/design/application/rest_api_swagger.md
- Command line
-
hf download hf://spaces/thanhnv2323/humanize-text-python/docs/md/design/application/rest_api_swagger.md
-
curl -L -o rest_api_swagger.md https://huggingface.co/spaces/thanhnv2323/humanize-text-python/resolve/main/docs/md/design/application/rest_api_swagger.md
1.18 kB
REST API Swagger (OpenAPI)
The REST server is implemented with FastAPI, which generates the Swagger/OpenAPI specification at runtime:
- Swagger UI:
http://localhost:8000/docs - OpenAPI JSON:
http://localhost:8000/openapi.json
Quick export (optional)
Once dependencies are installed, you can export the OpenAPI JSON to a file:
python -c "from adsp.app.api_server import app; import json; print(json.dumps(app.openapi(), indent=2))" > openapi.json
Contract summary
For the authoritative schema, use /openapi.json. The key routes are:
GET /healthPOST /v1/auth/registerPOST /v1/auth/validateGET /v1/personasGET /v1/personas/{persona_id}/profileGET /v1/personas/{persona_id}/system-promptPOST /v1/chatPOST /v1/ingestion/uploadPOST /v1/reports/{persona_id}GET /api/surveysPOST /api/surveysGET /api/surveys/{survey_id}GET /api/groupsPOST /api/groupsGET /api/groups/countriesGET /api/groups/{group_id}POST /api/surveys/{survey_id}/simulateGET /api/surveys/{survey_id}/responses
All request/response fields now expose descriptions and examples directly in Swagger UI.