{"openapi":"3.1.0","info":{"title":"Shiftyasan Public Solver API","version":"v1","description":"Shift scheduling optimization API backed by a constraint-optimization engine. Public endpoints under /v1/public/*.","contact":{"url":"https://shiftyasan.com"},"license":{"name":"Proprietary (use governed by terms of service)"}},"servers":[{"url":"https://api.shiftyasan.com/v1/public","description":"production"}],"paths":{"/solve/validate":{"post":{"operationId":"validate_shift_input","summary":"Validate a solve request without billing or running the solver","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolveRequest"}}}},"responses":{"200":{"description":"Valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateResponse"}}}},"400":{"description":"Invalid JSON in request body","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Request body exceeds 1 MB hard cap","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Content-Type must be application/json","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Validation error (zod schema mismatch or TranslationError)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/solve":{"post":{"security":[{"bearerAuth":[]}],"operationId":"solve_shift","summary":"Solve a shift schedule (large problems return 202 + job_id)","description":"Call validate_shift_input first — free, and catches mistakes before units are spent. Large problems return 202 with a job_id; poll get_solve_job until it completes. On 422, diagnosis.causes[] names the constraints to relax. Understaffing yields shortage markers, not an error.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolveRequest"}}}},"responses":{"200":{"description":"Solved. For x402-authorized requests, `X-PAYMENT-RESPONSE` carries the base64 settle response (or is absent if settlement failed; see `X-Shiftyasan-Settle-Status` in that case).","headers":{"X-PAYMENT-RESPONSE":{"description":"Base64-encoded x402 SettleResponse. Present only when the request was authorized via x402 and `/settle` succeeded.","schema":{"type":"string"}},"X-Shiftyasan-Settle-Status":{"description":"Set when an x402 request was processed but settlement failed. Operators reconcile offline. Absent on successful settlement. Values: \"failed\" (facilitator returned `success: false`, e.g. nonce collision), \"facilitator_error\" (facilitator API was unreachable), \"internal_error\" (unexpected gateway-side exception during settle — gateway bug; check stack trace).","schema":{"type":"string","enum":["failed","facilitator_error","internal_error"]}},"X-Units-Consumed":{"description":"Units consumed by this request (api_key path). 0 when nothing was consumed.","schema":{"type":"integer"}},"X-Units-Remaining":{"description":"Remaining available units after this request (api_key path).","schema":{"type":"integer"}},"X-Shiftyasan-Billing-Status":{"description":"Set to \"failed\" when the solution was delivered but the usage/credit finalize transaction failed (operators reconcile offline). Absent on success.","schema":{"type":"string","enum":["failed"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolveResponse"}}}},"202":{"description":"Accepted (asynchronous pro path). Problems larger than the basic class (roughly employees × shifts × duties × days > 80,000) are queued and solved on a high-memory instance. Poll GET /solve/jobs/{job_id} until status becomes \"completed\" or \"failed\". Requires an API key on the pro tier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolveResponse"}}}},"400":{"description":"Invalid JSON in request body","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Authentication failed. Either: (a) API key invalid/disabled (Bearer challenge), (b) x402 X-PAYMENT header malformed or rejected by facilitator /verify (X402 challenge), or (c) x402 X-PAYMENT was sent to an environment where x402 is not configured. The `WWW-Authenticate` header indicates which scheme rejected the request.","headers":{"WWW-Authenticate":{"description":"Bearer (api_key path) or X402 (x402 path), depending on which middleware rejected the request.","schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"402":{"description":"No valid auth credential. Body `accepts[]` lists supported payment schemes (api_key / x402 / mpp); pick one and retry. The response carries one `WWW-Authenticate` header field per supported scheme (RFC 9110 §11.6.1) so that scheme parameter commas (e.g. `Payment realm=\"...\", profile=\"stripe-link\"`) cannot be misparsed.","headers":{"WWW-Authenticate":{"description":"One header field per supported scheme. Bearer (api_key), X402 (x402), Payment with profile=\"stripe-link\" (Stripe Link / MPP). May appear repeated in the response.","schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredProblem"}}}},"413":{"description":"Request body exceeds 1 MB hard cap","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Content-Type must be application/json","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Validation error, tier limit exceeded, or no feasible solution. When the solver proves the constraints contradictory (type `.../errors/solver-infeasible`), the body may include a `diagnosis` object: the gateway re-solves short probe variants with one hard constraint removed at a time and reports the constraints whose removal resolves the contradiction as `diagnosis.causes[]` ({cause_type, field, message}, most likely first). Use it to tell the user which constraint to relax.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/SolveProblem"}}}},"429":{"description":"Free quota / prepaid balance exhausted (api_key path). Unlike rate limiting this does NOT recover by waiting (top up or wait for quota reset); no Retry-After is sent. `type` is https://api.shiftyasan.com/errors/quota-exceeded.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"501":{"description":"Async path not yet implemented (timeout > 30s)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Upstream temporarily unavailable. Returned when (a) SOLVER_V1_URL is not configured (gateway misconfig), (b) the API key store (Postgres) is unreachable, (c) the x402 facilitator `/verify` endpoint is unreachable, or (d) x402 misconfiguration is detected while building payment requirements (e.g. invalid CAIP-2 network format). Clients should retry after the Retry-After header.","headers":{"Retry-After":{"description":"Seconds to wait before retry (recommended).","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"504":{"description":"Solver timed out","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/solve/jobs/{id}":{"get":{"security":[{"bearerAuth":[]}],"operationId":"get_solve_job","summary":"Poll an asynchronous solve job (pro path)","description":"Poll a job created by solve_shift (202). status is \"running\" (retry after Retry-After), \"completed\" (solution + usage), or \"failed\". When error.code is \"no_solution\", error.diagnosis names the constraints to relax — if absent, poll once more a minute later. Only your own jobs are visible.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"job_id returned by the 202 response of POST /solve"}],"responses":{"200":{"description":"Job state (running / completed / failed)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolveResponse"}}}},"401":{"description":"API key required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"No job with this id belongs to your account","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/usage":{"get":{"security":[{"bearerAuth":[]}],"operationId":"get_usage","summary":"Get the usage/quota summary for the authenticated API key","description":"Returns free-quota remaining, prepaid balance, and total available units for the API key. Useful for agents/operators to check remaining quota before calling /solve. Requires Bearer api_key auth.","responses":{"200":{"description":"Usage summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"401":{"description":"API key authentication required or invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Usage store (database) temporarily unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key issued at https://platform.shiftyasan.com/dashboard/. Send as `Authorization: Bearer sk_live_...`."}},"schemas":{"SolveRequest":{"type":"object","properties":{"schedule_period":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601 date (YYYY-MM-DD), no time, no timezone."},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601 date (YYYY-MM-DD), no time, no timezone."},"holidays":{"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601 date (YYYY-MM-DD), no time, no timezone."},"default":[]},"timezone":{"type":"string","minLength":1,"description":"IANA timezone name, e.g. \"Asia/Tokyo\" or \"UTC\".","default":"UTC"}},"required":["start_date","end_date"],"additionalProperties":false,"description":"Scheduling horizon plus holidays and the timezone the dates are in."},"shifts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"name":{"type":"string","minLength":1,"maxLength":200},"working_hours":{"type":"object","properties":{"start_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"Wall-clock time in 24-hour HH:MM format."},"end_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"Wall-clock time in 24-hour HH:MM format."}},"required":["start_time","end_time"],"additionalProperties":false,"description":"Wall-clock shift span. May span midnight (e.g. start_time > end_time)."},"staffing_demand":{"type":"array","items":{"type":"object","properties":{"min":{"type":"integer","minimum":0},"max":{"type":"integer","minimum":0}},"required":["min","max"],"additionalProperties":false,"description":"Inclusive headcount range [min, max] with min <= max, both >= 0."},"minItems":1},"manager_demand":{"type":"array","items":{"type":"object","properties":{"min":{"type":"integer","minimum":0},"max":{"type":"integer","minimum":0}},"required":["min","max"],"additionalProperties":false,"description":"Inclusive headcount range [min, max] with min <= max, both >= 0."}}},"required":["id","name","staffing_demand"],"additionalProperties":false,"description":"A shift type (e.g. morning, evening) with per-day staffing demand."},"minItems":1,"maxItems":12},"duties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"name":{"type":"string","minLength":1,"maxLength":200},"staffing_demand_by_shift":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"min":{"type":"integer","minimum":0},"max":{"type":"integer","minimum":0}},"required":["min","max"],"additionalProperties":false,"description":"Inclusive headcount range [min, max] with min <= max, both >= 0."},"minItems":1}}},"required":["id","name","staffing_demand_by_shift"],"additionalProperties":false,"description":"A duty (role) within a shift, with per-shift per-day staffing demand."},"maxItems":15,"default":[]},"employees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"name":{"type":"string","maxLength":200},"is_manager":{"type":"boolean","default":false},"assignable_shift_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"minItems":1},"skill_levels":{"type":"object","additionalProperties":{"type":"integer","minimum":0,"maximum":10},"default":{}},"preferences":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["day_off"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601 date (YYYY-MM-DD), no time, no timezone."}},"required":["type","date"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["preferred_shift"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601 date (YYYY-MM-DD), no time, no timezone."},"shift_id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."}},"required":["type","date","shift_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["avoided_shift"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601 date (YYYY-MM-DD), no time, no timezone."},"shift_id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."}},"required":["type","date","shift_id"],"additionalProperties":false}],"description":"Soft preference for a specific date."},"default":[]},"fixed_assignments":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601 date (YYYY-MM-DD), no time, no timezone."},"shift_id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"duty_id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."}},"required":["date","shift_id"],"additionalProperties":false,"description":"Hard fixed assignment for a date. duty_id may be omitted to fix only the shift."},"default":[]},"working_days_per_month":{"type":"object","properties":{"min":{"type":"integer","minimum":0},"max":{"type":"integer","minimum":0}},"required":["min","max"],"additionalProperties":false,"description":"Inclusive headcount range [min, max] with min <= max, both >= 0."},"working_days_per_week":{"type":"object","properties":{"min":{"type":"integer","minimum":0},"max":{"type":"integer","minimum":0}},"required":["min","max"],"additionalProperties":false,"description":"Inclusive headcount range [min, max] with min <= max, both >= 0."},"available_weekdays":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"],"description":"Weekday name (three-letter, lowercase)."},"minItems":1,"maxItems":7},"shift_count_limits":{"type":"array","items":{"type":"object","properties":{"shift_id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"min":{"type":"integer","minimum":0},"max":{"type":"integer","minimum":0}},"required":["shift_id"],"additionalProperties":false,"description":"Per-shift assignment count bound over the schedule period (e.g. at most 4 night shifts). At least one of min/max is required; both are hard."},"default":[]},"weekly_working_hours_limit":{"type":"object","properties":{"hours":{"type":"integer","exclusiveMinimum":0,"maximum":168},"enforcement":{"type":"string","enum":["soft","hard"],"default":"hard"}},"required":["hours"],"additionalProperties":false}},"required":["id","assignable_shift_ids"],"additionalProperties":false,"description":"Employee with availability, skill levels, preferences, and assignment limits."},"minItems":1,"maxItems":50},"constraints":{"type":"object","properties":{"shift_transitions":{"type":"array","items":{"type":"object","properties":{"from_shift_id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"to_shift_id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"rule":{"type":"string","enum":["forbid","require"]},"enforcement":{"type":"string","enum":["hard","soft"],"default":"hard"}},"required":["from_shift_id","to_shift_id","rule"],"additionalProperties":false,"description":"Constraint on consecutive-day shift transitions."},"default":[]},"max_consecutive_working_days":{"type":"integer","exclusiveMinimum":0,"description":"Maximum consecutive working days. IMPORTANT: omitting this does NOT mean unlimited — the solver applies a built-in default of a hard cap of 6 consecutive days (and prefers at most 5). Set it explicitly to change that (e.g. 7 to allow a full week in a row)."},"employee_pairings":{"type":"array","items":{"type":"object","properties":{"employee_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"minItems":2},"rule":{"type":"string","enum":["exclude","require"]}},"required":["employee_ids","rule"],"additionalProperties":false,"description":"Pairing constraint between two or more employees."},"default":[]},"skill_support":{"type":"object","properties":{"scope":{"type":"string","enum":["shift","duty"]},"enforcement":{"type":"string","enum":["hard","soft"],"default":"soft"}},"required":["scope"],"additionalProperties":false,"description":"Pair beginners with seniors on the same shift or duty."},"cross_shift_demands":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601 date (YYYY-MM-DD), no time, no timezone."},"shift_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"minItems":1},"duty_id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"managers_only":{"type":"boolean","default":false},"min":{"type":"integer","minimum":0},"max":{"type":"integer","minimum":0}},"required":["date","shift_ids"],"additionalProperties":false,"description":"Headcount bound across multiple shifts on one date (time-band style demand: pick the shifts that cover the band)."},"default":[]},"fairness_groups":{"type":"array","items":{"type":"object","properties":{"target_shift_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"minItems":1},"policy":{"type":"string","enum":["proportional","equal"],"default":"proportional"},"penalty_weight":{"type":"integer","exclusiveMinimum":0}},"required":["target_shift_ids"],"additionalProperties":false,"description":"Fair distribution of burdensome shifts across eligible employees."},"maxItems":4,"default":[]}},"additionalProperties":false,"description":"Cross-cutting constraints applied to all employees and shifts.","default":{"shift_transitions":[],"employee_pairings":[]}},"options":{"type":"object","properties":{"solver_timeout_seconds":{"type":"integer","minimum":1,"maximum":300,"default":30,"description":"Currently ignored: whether a request is solved synchronously or queued is decided by problem size, not by this value."}},"additionalProperties":false,"description":"Solver tuning knobs.","default":{"solver_timeout_seconds":30}}},"required":["schedule_period","shifts","employees"],"additionalProperties":false,"description":"Constraints enforced at solve time (not all expressible in JSON Schema): (1) each `staffing_demand` / `staffing_demand_by_shift` array length MUST equal the number of days in `schedule_period` (start_date..end_date inclusive); (2) every `{ min, max }` MUST satisfy min <= max; (3) `schedule_period.start_date` <= `schedule_period.end_date`; (4) each `employees[].assignable_shift_ids` entry MUST reference an existing `shifts[].id`; (5) each `constraints.fairness_groups[].target_shift_ids` entry MUST reference an existing `shifts[].id`; (6) each `constraints.cross_shift_demands[]` entry MUST include min and/or max (min <= max), reference existing shift/duty ids, and use a date inside `schedule_period`; (7) `shifts[].manager_demand`, when present, MUST have the same length as `staffing_demand`; (8) when `employees[].weekly_working_hours_limit` is set, every shift listed in that employee’s `assignable_shift_ids` MUST define `working_hours` (the limit is computed from shift start/end times); (9) each `employees[].shift_count_limits[]` entry MUST reference an existing `shifts[].id` and include min and/or max with min <= max."},"SolveResponse":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["completed","running","failed"]},"solution":{"anyOf":[{"type":"object","properties":{"assignments":{"type":"array","items":{"type":"object","properties":{"employee_id":{"type":"string","minLength":1,"maxLength":128,"description":"Caller-defined identifier (any non-empty string up to 128 chars)."},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601 date (YYYY-MM-DD), no time, no timezone."},"shift_id":{"type":"string"},"duty_id":{"type":"string"}},"required":["employee_id","date","shift_id"],"additionalProperties":false}},"metrics":{"type":"object","properties":{"solver_runtime_seconds":{"type":"number","minimum":0},"objective_value":{"type":"number"},"soft_constraint_violations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Constraint that was violated, e.g. \"transition(x)\"."},"penalty":{"type":"number","description":"Penalty the objective incurred for this violation."},"violated_by":{"type":"number","description":"Magnitude of the violation, for count-based penalties such as fairness excess."}},"required":["name","penalty"],"additionalProperties":false},"default":[]}},"required":["solver_runtime_seconds"],"additionalProperties":false}},"required":["assignments","metrics"],"additionalProperties":false},{"type":"null"}]},"usage":{"type":"object","properties":{"units_consumed":{"type":"integer","minimum":0},"units_remaining":{"type":"integer","minimum":0}},"required":["units_consumed","units_remaining"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"solver_status":{"type":"string"},"diagnosis":{"type":"object","properties":{"status":{"type":"string","enum":["identified","no_cause_identified"]},"causes":{"type":"array","items":{"type":"object","properties":{"cause_type":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"}},"required":["cause_type","field","message"],"additionalProperties":false}},"probes":{"type":"integer","minimum":0}},"required":["status","causes","probes"],"additionalProperties":false}},"required":["code"],"additionalProperties":false}},"required":["job_id","status","solution"],"additionalProperties":false},"ValidateResponse":{"type":"object","properties":{"valid":{"type":"boolean","enum":[true]},"schedule_days":{"type":"integer","exclusiveMinimum":0},"shift_count":{"type":"integer","minimum":0},"duty_count":{"type":"integer","minimum":0},"employee_count":{"type":"integer","minimum":0},"hints":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"hint":{"type":"string"}},"required":["field","hint"],"additionalProperties":false}}},"required":["valid","schedule_days","shift_count","duty_count","employee_count"],"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["type","title","status"],"additionalProperties":false},"SolveProblem":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"solver_status":{"type":"string"},"diagnosis":{"type":"object","properties":{"status":{"type":"string","enum":["identified","no_cause_identified"]},"causes":{"type":"array","items":{"type":"object","properties":{"cause_type":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"}},"required":["cause_type","field","message"],"additionalProperties":false}},"probes":{"type":"integer","minimum":0}},"required":["status","causes","probes"],"additionalProperties":false}},"required":["type","title","status"],"additionalProperties":false},"PaymentRequiredProblem":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"number","enum":[402]},"detail":{"type":"string"},"instance":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"message":{"type":"string"},"code":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"accepts":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"scheme":{"type":"string","enum":["api_key"]},"description":{"type":"string"},"docs":{"type":"string","format":"uri"}},"required":["scheme","description"],"additionalProperties":false},{"type":"object","properties":{"scheme":{"type":"string","enum":["x402"]},"version":{"type":"integer"},"x402_scheme":{"type":"string"},"network":{"type":"string"},"pay_to":{"type":"string"},"asset":{"type":"string"},"max_amount_required":{"type":"string","pattern":"^[1-9][0-9]*$"},"max_timeout_seconds":{"type":"integer","exclusiveMinimum":0},"description":{"type":"string"},"docs":{"type":"string","format":"uri"}},"required":["scheme","version","x402_scheme","network","pay_to","asset","max_amount_required","max_timeout_seconds","description"],"additionalProperties":false},{"type":"object","properties":{"scheme":{"type":"string","enum":["mpp"]},"profile":{"type":"string"},"stripe_account":{"type":"string"},"amount_minor":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","pattern":"^[a-z]{3}$"},"description":{"type":"string"},"docs":{"type":"string","format":"uri"}},"required":["scheme","profile","stripe_account","amount_minor","currency","description"],"additionalProperties":false}]},"minItems":1}},"required":["type","title","status","accepts"],"additionalProperties":false},"UsageResponse":{"type":"object","properties":{"free_quota_remaining":{"type":"integer","minimum":0},"balance_units":{"type":"integer","minimum":0},"available_units":{"type":"integer","minimum":0}},"required":["free_quota_remaining","balance_units","available_units"],"additionalProperties":false}}}}