openapi: 3.2.0 info: title: Phi — Protein Design Auth API description: 'Phi is a biomodal computation platform for protein design. Submit structure-prediction and sequence-design jobs, track their status, and retrieve scored results — all via a single REST API. ## Authentication All endpoints require an API key supplied as `Authorization: Bearer ` or a Clerk session token. Organisation ID is derived automatically from Clerk tokens; static-key callers must include `X-Organization-ID`. ## Quick links - `POST /v1/phi/jobs` — submit a job - `GET /v1/phi/jobs/{job_id}/status` — poll status - `GET /v1/phi/jobs/{job_id}/scores` — download scored results ' version: 1.0.0 servers: - url: https://api.dyno-agents.app description: Production - url: http://localhost:8000 description: Local development tags: - name: auth paths: /v1/phi/auth/me: get: tags: - auth summary: Get Current User Profile description: "Return the Clerk-verified user profile and primary org ID.\n\n``org_id`` is sourced in priority order:\n 1. Directly from the verified token claims (``org_id`` claim in session JWTs\n and ``ak_…`` keys scoped to an org). This is the common path now that\n Clerk \"Membership required\" is enabled.\n 2. Fetched from the Clerk membership API when the token has no ``org_id``\n claim (older sessions / tokens issued without an active org context).\n 3. Returns a 422 if no org can be determined for a Clerk-authed caller, so\n the client receives a clear error instead of a silent \"default-org\" that\n would be rejected downstream.\n\nStatic API-key callers receive a stub profile; ``org_id`` comes from the\n``X-Organization-ID`` header or falls back to ``\"default-org\"``." operationId: get_current_user_profile_v1_phi_auth_me_get parameters: - name: x-api-key in: header required: false schema: anyOf: - type: string - type: 'null' description: API key for authentication title: X-Api-Key description: API key for authentication - name: X-User-ID in: header required: false schema: anyOf: - type: string - type: 'null' title: X-User-Id - name: X-Organization-ID in: header required: false schema: anyOf: - type: string - type: 'null' title: X-Organization-Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UserProfileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/phi/auth/me/quota: get: tags: - auth summary: Get My Quota description: 'Return the authenticated user''s quota limits and current usage. Available to any user with a valid Clerk JWT or ``ak_`` key — no admin privilege required. Use this to drive quota banners and progress bars in the frontend.' operationId: get_my_quota_v1_phi_auth_me_quota_get parameters: - name: x-api-key in: header required: false schema: anyOf: - type: string - type: 'null' description: API key for authentication title: X-Api-Key description: API key for authentication - name: X-User-ID in: header required: false schema: anyOf: - type: string - type: 'null' title: X-User-Id - name: X-Organization-ID in: header required: false schema: anyOf: - type: string - type: 'null' title: X-Organization-Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UserQuotaResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: UserProfileResponse: properties: user_id: type: string title: User Id email: anyOf: - type: string - type: 'null' title: Email display_name: anyOf: - type: string - type: 'null' title: Display Name org_id: type: string title: Org Id org_name: anyOf: - type: string - type: 'null' title: Org Name created_at: anyOf: - type: string - type: 'null' title: Created At type: object required: - user_id - email - display_name - org_id - org_name - created_at title: UserProfileResponse description: User profile returned by GET /v1/phi/auth/me. HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError UserQuotaResponse: properties: user_id: type: string title: User Id max_total_jobs: type: integer title: Max Total Jobs max_concurrent_jobs: type: integer title: Max Concurrent Jobs reset_at: anyOf: - type: string format: date-time - type: 'null' title: Reset At current_total_jobs: type: integer title: Current Total Jobs current_concurrent_jobs: type: integer title: Current Concurrent Jobs type: object required: - user_id - max_total_jobs - max_concurrent_jobs - current_total_jobs - current_concurrent_jobs title: UserQuotaResponse description: Quota limits and live usage for the authenticated user. ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError