humanize-text-python / docs /md /design /application /rest_api_swagger.md
thanhnv2323's picture
chore: update doc
33340fe
|
Raw History Blame Contribute Delete
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 /health
  • POST /v1/auth/register
  • POST /v1/auth/validate
  • GET /v1/personas
  • GET /v1/personas/{persona_id}/profile
  • GET /v1/personas/{persona_id}/system-prompt
  • POST /v1/chat
  • POST /v1/ingestion/upload
  • POST /v1/reports/{persona_id}
  • GET /api/surveys
  • POST /api/surveys
  • GET /api/surveys/{survey_id}
  • GET /api/groups
  • POST /api/groups
  • GET /api/groups/countries
  • GET /api/groups/{group_id}
  • POST /api/surveys/{survey_id}/simulate
  • GET /api/surveys/{survey_id}/responses

All request/response fields now expose descriptions and examples directly in Swagger UI.