{
	"openapi": "3.1.0",
	"info": {
		"title": "The Nostrad gateway",
		"version": "1",
		"description": "AI models, a file library and selling inside an app. Every command takes a person's Sign in with Nostrad access token or an API key, except the webhook signing key. Every answer has an x-request-id header: quote it when asking about a call."
	},
	"servers": [
		{
			"url": "https://gateway.nostrad.ai"
		}
	],
	"tags": [
		{
			"name": "Gateway"
		},
		{
			"name": "Whole Drive",
			"description": "Only for an app Nostrad has marked (its own sync and phone apps), with a person's sign-in that has the drive scope. An API key can't use these."
		},
		{
			"name": "Selling"
		}
	],
	"components": {
		"securitySchemes": {
			"signIn": {
				"type": "http",
				"scheme": "bearer",
				"description": "A person's Sign in with Nostrad access token. That person pays."
			},
			"apiKey": {
				"type": "http",
				"scheme": "bearer",
				"description": "An API key of the app, nsk_... Its owner pays."
			},
			"salesKey": {
				"type": "http",
				"scheme": "bearer",
				"description": "An API key of the app with Sales ticked. Keep it on your server only."
			}
		},
		"headers": {
			"ShouldRetry": {
				"description": "true when sending the same request again can work (408, 429 and 5xx, except answers that keep failing until something changes), false otherwise",
				"schema": {
					"type": "string",
					"enum": [
						"true",
						"false"
					]
				}
			}
		},
		"responses": {
			"E400": {
				"headers": {
					"x-should-retry": {
						"$ref": "#/components/headers/ShouldRetry"
					}
				},
				"description": "The request isn't valid: developer_error or invalid_purchase_state",
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/Error"
						}
					}
				}
			},
			"E401": {
				"headers": {
					"x-should-retry": {
						"$ref": "#/components/headers/ShouldRetry"
					}
				},
				"description": "No token, or one that ran out or was taken away",
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/Error"
						},
						"example": {
							"error": "unauthorized",
							"detail": "unauthorized"
						}
					}
				}
			},
			"E403": {
				"headers": {
					"x-should-retry": {
						"$ref": "#/components/headers/ShouldRetry"
					}
				},
				"description": "needs_sign_in, sales_permission_needed or billing_unavailable",
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/Error"
						}
					}
				}
			},
			"E404": {
				"headers": {
					"x-should-retry": {
						"$ref": "#/components/headers/ShouldRetry"
					}
				},
				"description": "unavailable, not_found or no_refund_request",
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/Error"
						}
					}
				}
			},
			"E409": {
				"headers": {
					"x-should-retry": {
						"$ref": "#/components/headers/ShouldRetry"
					}
				},
				"description": "already_owned, not_owned, already_refunded, refund_too_old, no_notify_url or pending_acknowledgement",
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/Error"
						}
					}
				}
			},
			"E410": {
				"headers": {
					"x-should-retry": {
						"$ref": "#/components/headers/ShouldRetry"
					}
				},
				"description": "no_longer_available: this subscription ended more than 60 days ago",
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/Error"
						}
					}
				}
			}
		},
		"schemas": {
			"Error": {
				"type": "object",
				"properties": {
					"error": {
						"type": "string",
						"description": "A code to branch on, always there: the reason's own (Google Play's name where there is one), else the status's type: invalid_request_error, authentication_error, billing_error, permission_error, not_found_error, conflict_error, request_too_large, rate_limit_error, api_error or timeout_error. New codes may be added"
					},
					"detail": {
						"type": "string",
						"description": "In words, for a person; don't parse it"
					}
				},
				"required": [
					"error",
					"detail"
				]
			},
			"Budget": {
				"type": "object",
				"properties": {
					"scope": {
						"type": "string",
						"description": "",
						"enum": [
							"api_key",
							"app",
							"account"
						]
					},
					"limit_usd": {
						"type": "number"
					},
					"spend_usd": {
						"type": "number",
						"description": "Counted against it this month"
					},
					"remaining_usd": {
						"type": "number",
						"description": "Zero or less blocks jobs"
					},
					"reset_interval": {
						"const": "monthly"
					},
					"resets_at": {
						"type": "string",
						"description": "ISO 8601 UTC",
						"format": "date-time"
					}
				}
			},
			"FieldError": {
				"type": "object",
				"properties": {
					"error": {
						"const": "invalid_fields"
					},
					"detail": {
						"type": "string",
						"description": "In words"
					},
					"metadata": {
						"type": "object",
						"properties": {
							"invalid_fields": {
								"type": "array",
								"maxItems": 50,
								"items": {
									"type": "object",
									"properties": {
										"type": {
											"type": "string",
											"description": "Branch on this",
											"enum": [
												"required",
												"invalid_value",
												"additional_property_not_allowed"
											]
										},
										"field": {
											"type": "string",
											"description": "Where it is: a top-level field, or inputs.<key> / params.<key>"
										},
										"description": {
											"type": "string",
											"description": "In words"
										}
									}
								}
							}
						}
					}
				}
			},
			"CreditError": {
				"type": "object",
				"properties": {
					"error": {
						"const": "no_balance"
					},
					"detail": {
						"type": "string",
						"description": "In words"
					},
					"metadata": {
						"type": "object",
						"properties": {
							"limit_source": {
								"const": "nostrad_credits"
							},
							"scope": {
								"const": "account"
							},
							"remedy_hint": {
								"type": "string",
								"description": "A next step for people reading logs"
							}
						}
					}
				}
			},
			"LimitError": {
				"type": "object",
				"properties": {
					"error": {
						"type": "string",
						"description": "over_limit, account_limit or concurrent_requests_limit"
					},
					"detail": {
						"type": "string",
						"description": "In words: a money limit ends with $X of $Y used and when it resets"
					},
					"metadata": {
						"type": "object",
						"properties": {
							"limit_source": {
								"type": "string",
								"description": "Branch on this, not on the words",
								"enum": [
									"nostrad_app_limit",
									"nostrad_key_limit",
									"nostrad_account_limit",
									"nostrad_jobs_at_once"
								]
							},
							"scope": {
								"type": "string",
								"description": "",
								"enum": [
									"app",
									"api_key",
									"account"
								]
							},
							"limit": {
								"type": "integer",
								"description": "concurrent_requests_limit only: how many of the account's jobs may run at once"
							},
							"limit_usd": {
								"type": "number",
								"description": "The limit, US dollars"
							},
							"spend_usd": {
								"type": "number",
								"description": "This month's use before this job, US dollars"
							},
							"resets_at": {
								"type": "string",
								"description": "When the month rolls over, ISO 8601 UTC",
								"format": "date-time"
							},
							"remedy_hint": {
								"type": "string",
								"description": "A next step for people reading logs"
							}
						}
					}
				}
			},
			"Product": {
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The product ID"
					},
					"type": {
						"type": "string",
						"description": "",
						"enum": [
							"consumable",
							"non_consumable",
							"subscription"
						]
					},
					"name": {
						"type": "string",
						"description": "Display name"
					},
					"description": {
						"type": "string",
						"description": "What buyers see"
					},
					"price": {
						"type": "object",
						"properties": {
							"credits": {
								"type": "integer",
								"description": "1 credit is 1 US cent"
							},
							"usd": {
								"type": "string",
								"description": "The price in dollars"
							}
						}
					},
					"display_price": {
						"type": "string",
						"description": "Show this, never your own price list"
					},
					"multi_quantity": {
						"type": "boolean",
						"description": "Up to 10 in a purchase"
					},
					"owned": {
						"type": "boolean",
						"description": "Only for a person's token: they own it and can't buy it again"
					}
				}
			},
			"Purchase": {
				"type": "object",
				"properties": {
					"purchase_token": {
						"type": "string",
						"description": "pt_..."
					},
					"order_id": {
						"type": "string",
						"description": "NOS.1234-5678-9012-34567"
					},
					"product": {
						"type": "string",
						"description": "The product ID"
					},
					"type": {
						"type": "string",
						"description": "consumable or non_consumable"
					},
					"quantity": {
						"type": "integer",
						"description": "How many"
					},
					"refundable_quantity": {
						"type": "integer",
						"description": "How many can still be refunded"
					},
					"state": {
						"type": "string",
						"description": "cancelled once it was refunded and taken back",
						"enum": [
							"purchased",
							"cancelled"
						]
					},
					"acknowledgement": {
						"type": "string",
						"description": "",
						"enum": [
							"pending",
							"acknowledged"
						]
					},
					"consumption": {
						"type": "string",
						"description": "Consumables only",
						"enum": [
							"not_consumed",
							"consumed"
						]
					},
					"account_token": {
						"type": "string",
						"description": "Your own ID for the person"
					},
					"purchased_at": {
						"type": "integer",
						"description": "Milliseconds since 1970"
					},
					"price": {
						"type": "object",
						"properties": {
							"credits": {
								"type": "integer"
							},
							"usd": {
								"type": "string"
							}
						}
					},
					"refunded": {
						"type": "integer",
						"description": "Credits refunded so far"
					},
					"test": {
						"type": "boolean",
						"description": "A test purchase: no credit moved"
					},
					"acknowledge_by": {
						"type": [
							"integer",
							"null"
						],
						"description": "When it's refunded unless acknowledged; null once acknowledged"
					}
				}
			},
			"Subscription": {
				"type": "object",
				"properties": {
					"purchase_token": {
						"type": "string",
						"description": "pt_..., kept across renewals"
					},
					"type": {
						"const": "subscription"
					},
					"state": {
						"type": "string",
						"description": "",
						"enum": [
							"active",
							"in_grace_period",
							"on_hold",
							"canceled",
							"expired"
						]
					},
					"product": {
						"type": "string"
					},
					"group": {
						"type": "string"
					},
					"period": {
						"type": "string",
						"description": "",
						"enum": [
							"P1W",
							"P1M",
							"P3M",
							"P6M",
							"P1Y"
						]
					},
					"started_at": {
						"type": "integer",
						"description": "Milliseconds since 1970"
					},
					"expires_at": {
						"type": "integer",
						"description": "Milliseconds since 1970"
					},
					"auto_renew": {
						"type": "boolean"
					},
					"latest_order_id": {
						"type": "string"
					},
					"price": {
						"type": "object",
						"properties": {
							"credits": {
								"type": "integer"
							},
							"usd": {
								"type": "string"
							}
						}
					},
					"linked_purchase_token": {
						"type": [
							"string",
							"null"
						],
						"description": "The token this one replaced"
					},
					"acknowledgement": {
						"type": "string"
					},
					"acknowledge_by": {
						"type": [
							"integer",
							"null"
						]
					},
					"account_token": {
						"type": "string"
					},
					"test": {
						"type": "boolean"
					},
					"canceled": {
						"type": "object",
						"properties": {
							"by": {
								"type": "string",
								"description": "",
								"enum": [
									"customer",
									"developer",
									"system",
									"replacement"
								]
							},
							"at": {
								"type": "integer",
								"description": "Milliseconds since 1970"
							}
						}
					},
					"expiration_reason": {
						"type": "string",
						"description": "",
						"enum": [
							"canceled",
							"billing_error",
							"price_increase_not_accepted",
							"product_unavailable"
						]
					},
					"price_change": {
						"type": "object",
						"properties": {
							"new_price": {
								"type": "integer"
							},
							"state": {
								"type": "string",
								"description": "",
								"enum": [
									"outstanding",
									"confirmed",
									"applied",
									"canceled"
								]
							},
							"charge_at": {
								"type": "integer",
								"description": "Milliseconds since 1970"
							}
						}
					},
					"grace_ends_at": {
						"type": "integer",
						"description": "Milliseconds since 1970"
					},
					"revoked_at": {
						"type": "integer",
						"description": "Milliseconds since 1970"
					},
					"deferred_change": {
						"type": "object",
						"properties": {
							"product": {
								"type": "string"
							},
							"price": {
								"type": "integer"
							},
							"at": {
								"type": "integer",
								"description": "Milliseconds since 1970"
							}
						}
					}
				}
			},
			"AppFigures": {
				"type": "object",
				"properties": {
					"request_count": {
						"type": "integer"
					},
					"success_count": {
						"type": "integer",
						"description": "Finished"
					},
					"user_error_count": {
						"type": "integer",
						"description": "Failed because of what was sent"
					},
					"error_count": {
						"type": "integer",
						"description": "Failed on Nostrad's side"
					},
					"p50_prepare_duration": {
						"type": [
							"integer",
							"null"
						],
						"description": "Seconds waited before starting"
					},
					"p75_prepare_duration": {
						"type": [
							"integer",
							"null"
						]
					},
					"p90_prepare_duration": {
						"type": [
							"integer",
							"null"
						]
					},
					"p50_duration": {
						"type": [
							"integer",
							"null"
						],
						"description": "Seconds run"
					},
					"p75_duration": {
						"type": [
							"integer",
							"null"
						]
					},
					"p90_duration": {
						"type": [
							"integer",
							"null"
						]
					},
					"active_people": {
						"type": [
							"integer",
							"null"
						],
						"description": "People signed in who ran a job; null when counts of people aren't shown"
					}
				}
			},
			"Order": {
				"allOf": [
					{
						"$ref": "#/components/schemas/Purchase"
					},
					{
						"type": "object",
						"properties": {
							"order_state": {
								"type": "string",
								"description": "",
								"enum": [
									"processed",
									"partially_refunded",
									"refunded"
								]
							},
							"refunds": {
								"type": "array",
								"items": {
									"type": "object",
									"properties": {
										"amount": {
											"type": "integer"
										},
										"quantity": {
											"type": [
												"integer",
												"null"
											]
										},
										"refund_type": {
											"type": "string"
										},
										"revoke": {
											"type": "boolean"
										},
										"source": {
											"type": "string"
										},
										"at": {
											"type": "integer",
											"description": "Milliseconds since 1970"
										}
									}
								}
							}
						}
					}
				]
			}
		}
	},
	"paths": {
		"/v1/models": {
			"get": {
				"summary": "The models this token may use, with each model's inputs, settings and price",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				}
			}
		},
		"/v1/voices": {
			"get": {
				"summary": "The voices a speech model takes as voice_id",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "model",
						"in": "query",
						"description": "The model's ID",
						"schema": {
							"type": "string"
						},
						"required": true
					}
				]
			}
		},
		"/v1/key": {
			"get": {
				"summary": "This key's (or sign-in's) use and limits, the same fields as OpenRouter's key check",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The key",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"data": {
											"type": "object",
											"properties": {
												"user_id": {
													"type": [
														"string",
														"null"
													],
													"description": "Who this is, to your app only: the same each time they sign in, different in every other app"
												},
												"label": {
													"type": [
														"string",
														"null"
													],
													"description": "The key's name; null for a sign-in token"
												},
												"via": {
													"type": "string",
													"description": "",
													"enum": [
														"key",
														"signin"
													]
												},
												"limit": {
													"type": "number",
													"description": "The key's monthly limit, or the one the person set for this app, US dollars"
												},
												"limit_reset": {
													"const": "monthly"
												},
												"limit_remaining": {
													"type": "number"
												},
												"usage": {
													"type": "number",
													"description": "All time, US dollars"
												},
												"usage_daily": {
													"type": "number",
													"description": "This UTC day"
												},
												"usage_weekly": {
													"type": "number",
													"description": "This UTC week, from Monday"
												},
												"usage_monthly": {
													"type": "number",
													"description": "This UTC month"
												},
												"expires_at": {
													"type": [
														"string",
														"null"
													],
													"format": "date-time"
												},
												"budgets": {
													"type": "array",
													"items": {
														"$ref": "#/components/schemas/Budget"
													}
												},
												"effective_budget": {
													"oneOf": [
														{
															"$ref": "#/components/schemas/Budget"
														},
														{
															"type": "null"
														}
													],
													"description": "The one that blocks first"
												}
											}
										}
									}
								},
								"example": {
									"data": {
										"user_id": "usr_4f1c9a",
										"label": "Server key",
										"via": "key",
										"limit": 100,
										"limit_reset": "monthly",
										"limit_remaining": 87.5,
										"usage": 40.2,
										"usage_daily": 1.1,
										"usage_weekly": 6.3,
										"usage_monthly": 12.5,
										"expires_at": null,
										"budgets": [
											{
												"scope": "api_key",
												"limit_usd": 100,
												"spend_usd": 12.5,
												"remaining_usd": 87.5,
												"reset_interval": "monthly",
												"resets_at": "2026-12-01T00:00:00.000Z"
											},
											{
												"scope": "account",
												"limit_usd": 100,
												"spend_usd": 30,
												"remaining_usd": 70,
												"reset_interval": "monthly",
												"resets_at": "2026-12-01T00:00:00.000Z"
											}
										],
										"effective_budget": {
											"scope": "account",
											"limit_usd": 100,
											"spend_usd": 30,
											"remaining_usd": 70,
											"reset_interval": "monthly",
											"resets_at": "2026-12-01T00:00:00.000Z"
										}
									}
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				}
			}
		},
		"/v1/quote": {
			"post": {
				"summary": "The most a job would cost. Nothing runs and nothing is charged",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"400": {
						"description": "A field that's wrong (invalid_fields)",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/FieldError"
								},
								"example": {
									"error": "invalid_fields",
									"detail": "params.duraton: this model doesn't take duraton. This model takes inputs prompt, images and params aspect_ratio, resolution, n.",
									"metadata": {
										"invalid_fields": [
											{
												"type": "additional_property_not_allowed",
												"field": "params.duraton",
												"description": "this model doesn't take duraton"
											}
										]
									}
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"model": {
										"type": "string",
										"description": "The model's ID"
									},
									"inputs": {
										"type": "object",
										"additionalProperties": true
									},
									"params": {
										"type": "object",
										"additionalProperties": true
									},
									"webhook": {
										"type": "string",
										"description": "An https address called when the job ends, signed"
									},
									"keep": {
										"type": "boolean",
										"description": "Keep the job's files in the person's storage; otherwise they pass through"
									},
									"keep_path": {
										"type": "string",
										"description": "The folder inside the app's folder the kept files go in, like Pictures/Coats; the top without it"
									},
									"file_app_properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string"
										},
										"description": "Labels only this app sees, on every file the job makes"
									},
									"file_properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string"
										},
										"description": "Labels every app that can reach the file sees, on every file the job makes"
									},
									"require_parameters": {
										"type": "boolean",
										"description": "Refuse keys under inputs and params that the model doesn't list (400 invalid_fields) instead of ignoring them; OpenRouter's switch"
									}
								},
								"required": [
									"model"
								]
							}
						}
					}
				}
			}
		},
		"/v1/jobs": {
			"post": {
				"summary": "Run a model",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "Done at once",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"202": {
						"description": "Still running",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"400": {
						"description": "A field that's wrong (invalid_fields), or another reason in detail",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/FieldError"
								},
								"example": {
									"error": "invalid_fields",
									"detail": "params.duraton: this model doesn't take duraton. This model takes inputs prompt, images and params aspect_ratio, resolution, n.",
									"metadata": {
										"invalid_fields": [
											{
												"type": "additional_property_not_allowed",
												"field": "params.duraton",
												"description": "this model doesn't take duraton"
											}
										]
									}
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"402": {
						"description": "Not enough credit (no_balance)",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/CreditError"
								},
								"example": {
									"error": "no_balance",
									"detail": "not enough credit for this job; add credit at https://accounts.nostrad.ai/account#credit",
									"metadata": {
										"limit_source": "nostrad_credits",
										"scope": "account",
										"remedy_hint": "Add credit at https://accounts.nostrad.ai/account#credit, or turn on auto top-up there."
									}
								}
							}
						}
					},
					"403": {
						"description": "Refused: over_limit (the monthly limit for this app or API key), or another reason in detail",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/LimitError"
								},
								"example": {
									"error": "over_limit",
									"detail": "this would go over the monthly limit set for this app; $4.98 of $5.00 used; resets 2026-12-01T00:00:00.000Z.",
									"metadata": {
										"limit_source": "nostrad_app_limit",
										"scope": "app",
										"limit_usd": 5,
										"spend_usd": 4.98,
										"resets_at": "2026-12-01T00:00:00.000Z",
										"remedy_hint": "Wait for the month to reset (see metadata.resets_at), or ask the person to raise their monthly limit for this app under Apps on accounts.nostrad.ai."
									}
								}
							}
						}
					},
					"422": {
						"description": "The Idempotency-Key was already used with a different body (idempotency_key_reused)",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Error"
								}
							}
						}
					},
					"429": {
						"description": "The account paying reached its monthly spending limit (account_limit), already has as many jobs running as it may (concurrent_requests_limit: start it again when one ends), or too many requests with one API key",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/LimitError"
								},
								"example": {
									"error": "concurrent_requests_limit",
									"detail": "this account already has 2 jobs running, the most it can run at once; start this one again when one of them ends",
									"metadata": {
										"limit_source": "nostrad_jobs_at_once",
										"scope": "account",
										"limit": 2,
										"remedy_hint": "Start the job again once one of the account's running jobs ends (GET /v1/jobs/<id>, or a webhook, says when). The number rises as the account buys credit: https://accounts.nostrad.ai/account#credit"
									}
								}
							}
						}
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"model": {
										"type": "string",
										"description": "The model's ID"
									},
									"inputs": {
										"type": "object",
										"additionalProperties": true
									},
									"params": {
										"type": "object",
										"additionalProperties": true
									},
									"webhook": {
										"type": "string",
										"description": "An https address called when the job ends, signed"
									},
									"keep": {
										"type": "boolean",
										"description": "Keep the job's files in the person's storage; otherwise they pass through"
									},
									"keep_path": {
										"type": "string",
										"description": "The folder inside the app's folder the kept files go in, like Pictures/Coats; the top without it"
									},
									"file_app_properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string"
										},
										"description": "Labels only this app sees, on every file the job makes"
									},
									"file_properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string"
										},
										"description": "Labels every app that can reach the file sees, on every file the job makes"
									},
									"require_parameters": {
										"type": "boolean",
										"description": "Refuse keys under inputs and params that the model doesn't list (400 invalid_fields) instead of ignoring them; OpenRouter's switch"
									}
								},
								"required": [
									"model"
								]
							}
						}
					}
				},
				"parameters": [
					{
						"name": "Idempotency-Key",
						"in": "header",
						"description": "Letters, digits, - and _, up to 100. A repeat with the same key starts nothing and answers the first request's job, with Idempotent-Replayed: true",
						"schema": {
							"type": "string",
							"pattern": "^[A-Za-z0-9_-]{1,100}$"
						}
					}
				]
			},
			"get": {
				"summary": "This app's jobs for this person, newest first, a page at a time",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "A page of jobs",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"jobs": {
											"type": "array",
											"items": {
												"type": "object",
												"additionalProperties": true
											}
										},
										"next_cursor": {
											"type": [
												"string",
												"null"
											],
											"description": "Pass as cursor for the next page"
										},
										"start": {
											"type": [
												"string",
												"null"
											]
										},
										"end": {
											"type": [
												"string",
												"null"
											]
										}
									}
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "start",
						"in": "query",
						"description": "ISO 8601; with none, back to the first job",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "end",
						"in": "query",
						"description": "ISO 8601, not included; default now",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "model",
						"in": "query",
						"description": "One model's ID",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "state",
						"in": "query",
						"description": "",
						"schema": {
							"type": "string",
							"enum": [
								"done",
								"failed",
								"processing",
								"queued"
							]
						}
					},
					{
						"name": "job",
						"in": "query",
						"description": "One job by its ID, whatever its date",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "limit",
						"in": "query",
						"description": "Up to 200; default 50",
						"schema": {
							"type": "integer",
							"maximum": 200
						}
					}
				]
			}
		},
		"/v1/jobs/{id}": {
			"get": {
				"summary": "One job, as it is now: a running job is checked with the model when read, at most once every 5 to 10 seconds",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/chat/completions": {
			"post": {
				"summary": "OpenAI's Chat Completions for a chat model, streamed (text/event-stream) or not, with tools",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#chat-completions"
				},
				"parameters": [
					{
						"name": "Idempotency-Key",
						"in": "header",
						"description": "As for POST /v1/jobs",
						"schema": {
							"type": "string",
							"pattern": "^[A-Za-z0-9_-]{1,100}$"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"model": {
										"type": "string",
										"description": "A chat model's ID"
									},
									"messages": {
										"type": "array",
										"items": {
											"type": "object",
											"additionalProperties": true
										},
										"description": "Roles system, developer, user, assistant (with tool_calls), tool (with tool_call_id)"
									},
									"stream": {
										"type": "boolean",
										"description": "Answer as server-sent events of chat.completion.chunk, then a usage chunk, then data: [DONE]"
									},
									"max_tokens": {
										"type": "integer",
										"description": ""
									},
									"max_completion_tokens": {
										"type": "integer",
										"description": "Taken as max_tokens"
									},
									"temperature": {
										"type": "number",
										"minimum": 0,
										"maximum": 2
									},
									"top_p": {
										"type": "number",
										"minimum": 0,
										"maximum": 1
									},
									"stop": {
										"oneOf": [
											{
												"type": "string"
											},
											{
												"type": "array",
												"items": {
													"type": "string"
												},
												"maxItems": 4
											}
										]
									},
									"response_format": {
										"type": "object",
										"additionalProperties": true
									},
									"tools": {
										"type": "array",
										"items": {
											"type": "object",
											"additionalProperties": true
										},
										"maxItems": 128
									},
									"tool_choice": {
										"oneOf": [
											{
												"type": "string",
												"enum": [
													"none",
													"auto",
													"required"
												]
											},
											{
												"type": "object",
												"additionalProperties": true
											}
										]
									},
									"parallel_tool_calls": {
										"type": "boolean",
										"description": ""
									},
									"reasoning_effort": {
										"type": "string",
										"description": "",
										"enum": [
											"none",
											"minimal",
											"low",
											"medium",
											"high",
											"xhigh",
											"max"
										]
									},
									"reasoning": {
										"type": "object",
										"properties": {
											"effort": {
												"type": "string",
												"description": "OpenRouter's name for reasoning_effort"
											}
										}
									},
									"require_parameters": {
										"type": "boolean",
										"description": "Refuse the request, listing every field Nostrad doesn't take"
									}
								},
								"required": [
									"model",
									"messages"
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The completion, or with stream: true the event stream",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"id": {
											"type": "string",
											"description": "The job's ID"
										},
										"object": {
											"type": "string",
											"description": "",
											"enum": [
												"chat.completion"
											]
										},
										"created": {
											"type": "integer",
											"description": "Seconds since 1970"
										},
										"model": {
											"type": "string",
											"description": "The model's ID"
										},
										"choices": {
											"type": "array",
											"items": {
												"type": "object",
												"additionalProperties": true
											}
										},
										"usage": {
											"type": "object",
											"properties": {
												"prompt_tokens": {
													"type": "integer",
													"description": ""
												},
												"completion_tokens": {
													"type": "integer",
													"description": ""
												},
												"total_tokens": {
													"type": "integer",
													"description": ""
												},
												"prompt_tokens_details": {
													"type": "object",
													"properties": {
														"cached_tokens": {
															"type": "integer",
															"description": ""
														}
													}
												},
												"cost": {
													"type": "number",
													"description": "What it was charged, US dollars"
												}
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Refused, as OpenRouter answers",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"error": {
											"type": "object",
											"properties": {
												"code": {
													"type": "integer",
													"description": "The HTTP status"
												},
												"message": {
													"type": "string",
													"description": ""
												},
												"type": {
													"type": "string",
													"description": "Nostrad's code, such as no_balance"
												},
												"metadata": {
													"type": "object",
													"additionalProperties": true
												}
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"description": "Refused, as OpenRouter answers",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"error": {
											"type": "object",
											"properties": {
												"code": {
													"type": "integer",
													"description": "The HTTP status"
												},
												"message": {
													"type": "string",
													"description": ""
												},
												"type": {
													"type": "string",
													"description": "Nostrad's code, such as no_balance"
												},
												"metadata": {
													"type": "object",
													"additionalProperties": true
												}
											}
										}
									}
								}
							}
						}
					},
					"402": {
						"description": "Refused, as OpenRouter answers",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"error": {
											"type": "object",
											"properties": {
												"code": {
													"type": "integer",
													"description": "The HTTP status"
												},
												"message": {
													"type": "string",
													"description": ""
												},
												"type": {
													"type": "string",
													"description": "Nostrad's code, such as no_balance"
												},
												"metadata": {
													"type": "object",
													"additionalProperties": true
												}
											}
										}
									}
								}
							}
						}
					},
					"403": {
						"description": "Refused, as OpenRouter answers",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"error": {
											"type": "object",
											"properties": {
												"code": {
													"type": "integer",
													"description": "The HTTP status"
												},
												"message": {
													"type": "string",
													"description": ""
												},
												"type": {
													"type": "string",
													"description": "Nostrad's code, such as no_balance"
												},
												"metadata": {
													"type": "object",
													"additionalProperties": true
												}
											}
										}
									}
								}
							}
						}
					},
					"404": {
						"description": "Refused, as OpenRouter answers",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"error": {
											"type": "object",
											"properties": {
												"code": {
													"type": "integer",
													"description": "The HTTP status"
												},
												"message": {
													"type": "string",
													"description": ""
												},
												"type": {
													"type": "string",
													"description": "Nostrad's code, such as no_balance"
												},
												"metadata": {
													"type": "object",
													"additionalProperties": true
												}
											}
										}
									}
								}
							}
						}
					},
					"422": {
						"description": "Refused, as OpenRouter answers",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"error": {
											"type": "object",
											"properties": {
												"code": {
													"type": "integer",
													"description": "The HTTP status"
												},
												"message": {
													"type": "string",
													"description": ""
												},
												"type": {
													"type": "string",
													"description": "Nostrad's code, such as no_balance"
												},
												"metadata": {
													"type": "object",
													"additionalProperties": true
												}
											}
										}
									}
								}
							}
						}
					},
					"429": {
						"description": "Refused, as OpenRouter answers",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"error": {
											"type": "object",
											"properties": {
												"code": {
													"type": "integer",
													"description": "The HTTP status"
												},
												"message": {
													"type": "string",
													"description": ""
												},
												"type": {
													"type": "string",
													"description": "Nostrad's code, such as no_balance"
												},
												"metadata": {
													"type": "object",
													"additionalProperties": true
												}
											}
										}
									}
								}
							}
						}
					},
					"502": {
						"description": "Refused, as OpenRouter answers",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"error": {
											"type": "object",
											"properties": {
												"code": {
													"type": "integer",
													"description": "The HTTP status"
												},
												"message": {
													"type": "string",
													"description": ""
												},
												"type": {
													"type": "string",
													"description": "Nostrad's code, such as no_balance"
												},
												"metadata": {
													"type": "object",
													"additionalProperties": true
												}
											}
										}
									}
								}
							}
						}
					},
					"503": {
						"description": "Refused, as OpenRouter answers",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"error": {
											"type": "object",
											"properties": {
												"code": {
													"type": "integer",
													"description": "The HTTP status"
												},
												"message": {
													"type": "string",
													"description": ""
												},
												"type": {
													"type": "string",
													"description": "Nostrad's code, such as no_balance"
												},
												"metadata": {
													"type": "object",
													"additionalProperties": true
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		},
		"/v1/jobs/{id}/cancel": {
			"post": {
				"summary": "Cancel a job that hasn't ended",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"202": {
						"description": "cancellation_requested",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"400": {
						"description": "already_completed",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"404": {
						"description": "not_found",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/app/analytics": {
			"get": {
				"summary": "Your whole app's requests over time (fal's analytics), with counts of the people signed in to it, never who they are. Counts of people show only when enough people ran a job in the range",
				"security": [
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The figures",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"app": {
											"type": "string",
											"description": "The app"
										},
										"start": {
											"type": "string",
											"description": "",
											"format": "date-time"
										},
										"end": {
											"type": "string",
											"description": "",
											"format": "date-time"
										},
										"timeframe": {
											"type": "string",
											"description": "",
											"enum": [
												"minute",
												"hour",
												"day",
												"week",
												"month"
											]
										},
										"via": {
											"type": "string",
											"description": "",
											"enum": [
												"all",
												"signin",
												"key"
											]
										},
										"model": {
											"type": [
												"string",
												"null"
											]
										},
										"totals": {
											"$ref": "#/components/schemas/AppFigures"
										},
										"time_series": {
											"type": "array",
											"items": {
												"allOf": [
													{
														"type": "object",
														"properties": {
															"bucket": {
																"type": "string",
																"description": "The bucket's start, UTC",
																"format": "date-time"
															}
														}
													},
													{
														"$ref": "#/components/schemas/AppFigures"
													}
												]
											}
										},
										"people": {
											"type": "object",
											"properties": {
												"shown": {
													"type": "boolean",
													"description": "false when fewer people than minimum ran a job in the range; then only minimum and detail"
												},
												"minimum": {
													"type": "integer",
													"description": "The fewest people counts are shown for"
												},
												"detail": {
													"type": "string",
													"description": "Why nothing is shown"
												},
												"active": {
													"type": "integer",
													"description": "People who ran at least one job"
												},
												"new": {
													"type": "integer",
													"description": "Whose first job in the app was in the range"
												},
												"returning": {
													"type": "integer",
													"description": "Who had run one before"
												},
												"active_last_28_days": {
													"type": [
														"integer",
														"null"
													],
													"description": "The 28 days up to end; null with fewer than minimum"
												},
												"retention": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"day": {
																"type": "integer",
																"description": "1, 7, 14 or 28"
															},
															"people": {
																"type": [
																	"integer",
																	"null"
																],
																"description": "First job in the range, and that day has come; null with fewer than minimum"
															},
															"returned": {
																"type": [
																	"integer",
																	"null"
																],
																"description": "Of them, ran a job again that UTC day"
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#app-activity"
				},
				"parameters": [
					{
						"name": "start",
						"in": "query",
						"description": "ISO 8601 date or date-time; default 24 hours before end",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "end",
						"in": "query",
						"description": "ISO 8601, not included; default now. At most 400 days after start",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "timeframe",
						"in": "query",
						"description": "Default from the range: minute under 2 hours, hour under 2 days, day under 64 days, week under 183 days, else month",
						"schema": {
							"type": "string",
							"enum": [
								"minute",
								"hour",
								"day",
								"week",
								"month"
							]
						}
					},
					{
						"name": "via",
						"in": "query",
						"description": "Only jobs through Sign in with Nostrad, or only your API keys'",
						"schema": {
							"type": "string",
							"enum": [
								"signin",
								"key"
							]
						}
					},
					{
						"name": "model",
						"in": "query",
						"description": "One model's ID",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/app/jobs": {
			"get": {
				"summary": "Every job of your app, newest first: with your keys and of every person signed in to it, never who they are or what they sent and got",
				"security": [
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "A page of jobs",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"jobs": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"job_id": {
														"type": "string",
														"description": "The job's ID"
													},
													"model": {
														"type": "string",
														"description": "The model's ID"
													},
													"modality": {
														"type": "string"
													},
													"via": {
														"type": "string",
														"description": "",
														"enum": [
															"signin",
															"key"
														]
													},
													"api_key": {
														"type": [
															"string",
															"null"
														],
														"description": "The key it was run with; null for a person's"
													},
													"yours": {
														"type": "boolean",
														"description": "Run with your keys or by you signed in: GET /v1/jobs/{id} gives its results"
													},
													"state": {
														"type": "string",
														"description": "",
														"enum": [
															"queued",
															"processing",
															"done",
															"failed"
														]
													},
													"error": {
														"type": [
															"string",
															"null"
														],
														"description": "What your app was told when it failed"
													},
													"error_type": {
														"type": [
															"string",
															"null"
														],
														"enum": [
															"invalid_request",
															"content_policy_violation",
															"nostrad_error",
															null
														],
														"description": "Why it failed, to branch on; null unless failed"
													},
													"retryable": {
														"type": [
															"boolean",
															"null"
														],
														"description": "Whether starting it again can work; null unless failed"
													},
													"cost_cents": {
														"type": [
															"integer",
															"null"
														],
														"description": "What it was charged, US cents"
													},
													"prepare_seconds": {
														"type": [
															"integer",
															"null"
														]
													},
													"duration_seconds": {
														"type": [
															"integer",
															"null"
														]
													},
													"usage": {
														"type": [
															"object",
															"null"
														],
														"additionalProperties": {
															"type": "number"
														},
														"description": "What a finished job used, in the units it was charged in"
													},
													"params": {
														"type": [
															"object",
															"null"
														],
														"additionalProperties": true,
														"description": "The settings a job of yours was sent; null for a person's"
													},
													"created_at": {
														"type": "integer",
														"description": "Seconds since 1970"
													},
													"finished_at": {
														"type": [
															"integer",
															"null"
														]
													}
												}
											}
										},
										"next_cursor": {
											"type": [
												"string",
												"null"
											],
											"description": "Pass as cursor for the next page"
										},
										"start": {
											"type": [
												"string",
												"null"
											]
										},
										"end": {
											"type": [
												"string",
												"null"
											]
										}
									}
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#app-activity"
				},
				"parameters": [
					{
						"name": "start",
						"in": "query",
						"description": "ISO 8601; default 30 days before end",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "end",
						"in": "query",
						"description": "ISO 8601, not included; default now",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "via",
						"in": "query",
						"description": "",
						"schema": {
							"type": "string",
							"enum": [
								"signin",
								"key"
							]
						}
					},
					{
						"name": "model",
						"in": "query",
						"description": "One model's ID",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "state",
						"in": "query",
						"description": "",
						"schema": {
							"type": "string",
							"enum": [
								"done",
								"failed",
								"processing",
								"queued"
							]
						}
					},
					{
						"name": "api_key",
						"in": "query",
						"description": "One key's jobs, key_...",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "modality",
						"in": "query",
						"description": "One kind of model, such as image or video",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "job",
						"in": "query",
						"description": "One job by its ID, whatever its date",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "limit",
						"in": "query",
						"description": "Up to 200; default 50",
						"schema": {
							"type": "integer",
							"maximum": 200
						}
					}
				]
			}
		},
		"/.well-known/nostrad-webhooks.json": {
			"get": {
				"summary": "The public key that signs webhooks and purchase notifications. No token needed",
				"security": [],
				"tags": [
					"Gateway"
				],
				"responses": {
					"200": {
						"description": "A JSON Web Key Set",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					}
				}
			}
		},
		"/files/{name}": {
			"get": {
				"summary": "A file in this app's folder for this person, or one the person picked for it. Range is supported",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The file's bytes"
					},
					"206": {
						"description": "The range asked for"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/files": {
			"post": {
				"summary": "Upload one file of up to 100 MB as the request body",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "x-file-name",
						"in": "header",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "x-keep",
						"in": "header",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "x-path",
						"in": "header",
						"description": "Percent-encoded: the folder inside the app's folder it goes in",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "x-app-properties",
						"in": "header",
						"description": "Percent-encoded JSON object: labels only this app sees",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "x-properties",
						"in": "header",
						"description": "Percent-encoded JSON object: labels every app that can reach the file sees",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/octet-stream": {
							"schema": {
								"type": "string",
								"format": "binary"
							}
						}
					}
				}
			},
			"get": {
				"summary": "This app's folder for this person, newest first",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "limit",
						"in": "query",
						"description": "How many",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "path",
						"in": "query",
						"description": "A folder",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "bin",
						"in": "query",
						"description": "1 for the bin",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "shared",
						"in": "query",
						"description": "1 for files picked for this app, from the person's Drive or a shared space they are in",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "app_property",
						"in": "query",
						"description": "key=value, or key: only files with this label of this app's; repeat for more",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "property",
						"in": "query",
						"description": "key=value, or key: only files with this label every app sees",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/files/{name}": {
			"get": {
				"summary": "One file's record",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					}
				]
			},
			"patch": {
				"summary": "Rename a file, move it inside the app's folder, or set its labels",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"name": {
										"type": "string"
									},
									"path": {
										"type": "string"
									},
									"app_properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string",
											"nullable": true
										},
										"description": "Labels only this app sees (Google Drive's appProperties); null removes a key"
									},
									"properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string",
											"nullable": true
										},
										"description": "Labels every app that can reach the file sees (Drive's properties)"
									}
								}
							}
						}
					}
				}
			},
			"delete": {
				"summary": "Move a file to the bin",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/files/{name}/restore": {
			"post": {
				"summary": "Take a file out of the bin",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/files/{name}/keep": {
			"post": {
				"summary": "Keep a temporary file in the person's Drive without sending it again, optionally in a folder of the app's folder",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": false,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"path": {
										"type": "string"
									},
									"app_properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string",
											"nullable": true
										},
										"description": "Labels only this app sees (Google Drive's appProperties); null removes a key"
									},
									"properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string",
											"nullable": true
										},
										"description": "Labels every app that can reach the file sees (Drive's properties)"
									}
								}
							}
						}
					}
				}
			}
		},
		"/v1/folders": {
			"post": {
				"summary": "Make an empty folder inside the app's folder: 201 made, 200 already there",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"201": {
						"description": "Made"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"path": {
										"type": "string"
									}
								}
							}
						}
					}
				}
			}
		},
		"/v1/files/{name}/link": {
			"get": {
				"summary": "The file's link that anyone can open, or null. With Sign in with Nostrad the person must have allowed the scope sharing",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					}
				]
			},
			"post": {
				"summary": "Make the file's link: 201 a new one, 200 the one already there. Only a kept file in this app's folder; needs Nostrad's file host",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"201": {
						"description": "A new link"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					}
				]
			},
			"delete": {
				"summary": "Remove the file's link; it stops opening for everyone",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/storage": {
			"get": {
				"summary": "The person's space: limit, used, remaining",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				}
			}
		},
		"/v1/changes": {
			"get": {
				"summary": "What changed among this app's files since the cursor",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/uploads": {
			"post": {
				"summary": "Start an upload in parts, for a file over 100 MB",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"type": {
										"type": "string"
									},
									"size": {
										"type": "integer"
									},
									"name": {
										"type": "string"
									},
									"part_size": {
										"type": "integer"
									},
									"path": {
										"type": "string",
										"description": "The folder inside the app's folder it goes in"
									},
									"app_properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string",
											"nullable": true
										},
										"description": "Labels only this app sees (Google Drive's appProperties); null removes a key"
									},
									"properties": {
										"type": "object",
										"additionalProperties": {
											"type": "string",
											"nullable": true
										},
										"description": "Labels every app that can reach the file sees (Drive's properties)"
									},
									"replaces": {
										"type": "string",
										"description": "A file in this app's folder to save a new version of"
									},
									"rev": {
										"type": "string",
										"nullable": true,
										"description": "The version you started from"
									},
									"note": {
										"type": "string",
										"description": "A note on the new version, up to 1,023 characters"
									}
								}
							}
						}
					}
				}
			}
		},
		"/v1/uploads/{id}": {
			"get": {
				"summary": "Which parts arrived and which are missing",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					}
				]
			},
			"delete": {
				"summary": "Cancel the upload",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/uploads/{id}/{n}": {
			"put": {
				"summary": "Part n",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "n",
						"in": "path",
						"required": true,
						"description": "The part's number",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/octet-stream": {
							"schema": {
								"type": "string",
								"format": "binary"
							}
						}
					}
				}
			}
		},
		"/v1/uploads/{id}/complete": {
			"post": {
				"summary": "Finish the upload",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Gateway"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive": {
			"get": {
				"summary": "How much of the person's space is used, place by place; each app folder in apps has its app's name (name, null if Nostrad can't say just then)",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/changes": {
			"get": {
				"summary": "What changed anywhere in the Drive since the cursor",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/changes/wait": {
			"get": {
				"summary": "Wait until something changes after the cursor, as Dropbox's longpoll: answers { changes: true } as soon as it does, or { changes: false } after the timeout. Then read /v1/drive/changes with the same cursor",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "timeout",
						"in": "query",
						"description": "Seconds to wait, 30 to 480 (30 if left out)",
						"schema": {
							"type": "integer"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/files": {
			"get": {
				"summary": "One place or folder, with its folders",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "place",
						"in": "query",
						"description": "mine, app, temporary, bin, history, recent, starred or everywhere",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "app",
						"in": "query",
						"description": "Which app's folder, with place=app",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "path",
						"in": "query",
						"description": "A folder",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "q",
						"in": "query",
						"description": "Words to find",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "type",
						"in": "query",
						"description": "A kind of file",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "sort",
						"in": "query",
						"description": "What to sort by",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "dir",
						"in": "query",
						"description": "asc or desc",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "since",
						"in": "query",
						"description": "Seconds",
						"schema": {
							"type": "integer"
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "folder_cursor",
						"in": "query",
						"description": "The folders' own cursor",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "limit",
						"in": "query",
						"description": "How many",
						"schema": {
							"type": "integer"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/files/{name}": {
			"get": {
				"summary": "One file's record",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				]
			},
			"patch": {
				"summary": "Rename a file, move it, or both",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"title": {
										"type": "string"
									},
									"to": {
										"type": "object",
										"properties": {
											"place": {
												"type": "string",
												"enum": [
													"mine",
													"app"
												]
											},
											"app": {
												"type": "string"
											},
											"path": {
												"type": "string"
											}
										},
										"required": [
											"place"
										]
									}
								}
							}
						}
					}
				}
			},
			"delete": {
				"summary": "Move a file to the Bin. There is no delete for good here, so a sync app's mistake can be undone",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/files/{name}/content": {
			"get": {
				"summary": "A file's bytes. Range and HEAD are supported",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The file's bytes"
					},
					"206": {
						"description": "The range asked for"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "acknowledge",
						"in": "query",
						"description": "1 to download a file marked as risky",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/files/{name}/thumbnail": {
			"get": {
				"summary": "A picture's thumbnail, WebP: small is 96, medium 176, large 800 on its longest side. 404 no_thumbnail if it has none: pictures up to 20 MB in PNG, JPEG, GIF, WebP or HEIC",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The picture"
					},
					"304": {
						"description": "Unchanged since the ETag you sent"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "size",
						"in": "query",
						"description": "small, medium or large",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/files/{name}/restore": {
			"post": {
				"summary": "Take a file out of the Bin",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "name",
						"in": "path",
						"required": true,
						"description": "The file's name",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/folders": {
			"post": {
				"summary": "Make a folder",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"place": {
										"type": "string",
										"enum": [
											"mine",
											"app"
										]
									},
									"app": {
										"type": "string"
									},
									"path": {
										"type": "string"
									}
								},
								"required": [
									"place"
								]
							}
						}
					}
				}
			},
			"patch": {
				"summary": "Rename a folder or move it",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"place": {
										"type": "string",
										"enum": [
											"mine",
											"app"
										]
									},
									"app": {
										"type": "string"
									},
									"path": {
										"type": "string"
									},
									"name": {
										"type": "string"
									},
									"to": {
										"type": "object",
										"properties": {
											"place": {
												"type": "string",
												"enum": [
													"mine",
													"app"
												]
											},
											"app": {
												"type": "string"
											},
											"path": {
												"type": "string"
											}
										},
										"required": [
											"place"
										]
									}
								},
								"required": [
									"place"
								]
							}
						}
					}
				}
			},
			"delete": {
				"summary": "Move a folder to the Bin",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "place",
						"in": "query",
						"description": "mine or app",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "app",
						"in": "query",
						"description": "Which app's folder, with place=app",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "path",
						"in": "query",
						"description": "The folder",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/folders/restore": {
			"post": {
				"summary": "Take a folder out of the Bin",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"place": {
										"type": "string",
										"enum": [
											"mine",
											"app"
										]
									},
									"app": {
										"type": "string"
									},
									"path": {
										"type": "string"
									},
									"binned_at": {
										"type": "integer"
									}
								},
								"required": [
									"place"
								]
							}
						}
					}
				}
			}
		},
		"/v1/drive/uploads": {
			"post": {
				"summary": "Start an upload, in parts, or a new version of a file with replaces",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "space",
						"in": "query",
						"description": "A shared space the person is in, spc_...",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"place": {
										"type": "string",
										"enum": [
											"mine",
											"app"
										]
									},
									"app": {
										"type": "string"
									},
									"path": {
										"type": "string"
									},
									"title": {
										"type": "string"
									},
									"type": {
										"type": "string"
									},
									"size": {
										"type": "integer"
									},
									"content_hash": {
										"type": "string"
									},
									"conflict": {
										"type": "string"
									},
									"replaces": {
										"type": "string",
										"description": "The file to save a new version of"
									},
									"rev": {
										"type": "string",
										"nullable": true,
										"description": "The version you started from"
									},
									"note": {
										"type": "string",
										"description": "A note on the new version"
									}
								}
							}
						}
					}
				}
			}
		},
		"/v1/drive/uploads/{id}": {
			"get": {
				"summary": "Which parts arrived and which are missing",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					}
				]
			},
			"delete": {
				"summary": "Cancel the upload",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/drive/uploads/{id}/{n}": {
			"put": {
				"summary": "Part n",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "n",
						"in": "path",
						"required": true,
						"description": "The part's number",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/octet-stream": {
							"schema": {
								"type": "string",
								"format": "binary"
							}
						}
					}
				}
			}
		},
		"/v1/drive/uploads/{id}/complete": {
			"post": {
				"summary": "Finish the upload",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The answer",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Whole Drive"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/#whole-drive"
				},
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"description": "The ID",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/products": {
			"get": {
				"summary": "What your app has on sale",
				"security": [
					{
						"signIn": []
					},
					{
						"apiKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The products",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"products": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Product"
											}
										},
										"unfetched": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"reason": {
														"type": "string"
													}
												}
											}
										}
									}
								},
								"example": {
									"products": [
										{
											"id": "coins_100",
											"type": "consumable",
											"name": "100 coins",
											"description": "A bag of coins",
											"price": {
												"credits": 199,
												"usd": "1.99"
											},
											"display_price": "$1.99",
											"multi_quantity": true,
											"owned": false
										}
									],
									"unfetched": [
										{
											"id": "level_2",
											"reason": "not_found_or_not_on_sale"
										}
									]
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/in-your-app/"
				},
				"parameters": [
					{
						"name": "ids",
						"in": "query",
						"description": "Up to 100 product IDs, separated by commas",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/purchases": {
			"post": {
				"summary": "Start a purchase for the signed-in person",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "The Nostrad page to send them to",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"purchase_url": {
											"type": "string"
										},
										"expires_at": {
											"type": "integer",
											"description": "Milliseconds since 1970"
										}
									}
								},
								"example": {
									"purchase_url": "https://accounts.nostrad.ai/purchase/pur_...",
									"expires_at": 1793000000000
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					},
					"409": {
						"$ref": "#/components/responses/E409"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/in-your-app/"
				},
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"product": {
										"type": "string",
										"description": "The product ID"
									},
									"quantity": {
										"type": "integer",
										"description": "1 to 10",
										"minimum": 1,
										"maximum": 10
									},
									"account_token": {
										"type": "string",
										"description": "Your own ID for the person, never an email address",
										"maxLength": 64
									},
									"return_url": {
										"type": "string",
										"description": "Where the browser goes after Buy or Cancel"
									}
								},
								"required": [
									"product",
									"return_url"
								]
							},
							"example": {
								"product": "coins_100",
								"quantity": 2,
								"account_token": "user-42",
								"return_url": "https://app.example/bought"
							}
						}
					}
				}
			},
			"get": {
				"summary": "What the signed-in person owns in your app now (restore)",
				"security": [
					{
						"signIn": []
					}
				],
				"responses": {
					"200": {
						"description": "What they own",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"purchases": {
											"type": "array",
											"items": {
												"oneOf": [
													{
														"$ref": "#/components/schemas/Purchase"
													},
													{
														"$ref": "#/components/schemas/Subscription"
													}
												]
											}
										}
									}
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/in-your-app/"
				}
			}
		},
		"/v1/purchases/voided": {
			"get": {
				"summary": "Purchases taken back in the last 30 days",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "Up to 1,000 a page",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/refunds/"
				},
				"parameters": [
					{
						"name": "start",
						"in": "query",
						"description": "Milliseconds",
						"schema": {
							"type": "integer"
						}
					},
					{
						"name": "end",
						"in": "query",
						"description": "Milliseconds",
						"schema": {
							"type": "integer"
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/purchases/{token}": {
			"get": {
				"summary": "One purchase, by its purchase token",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The purchase",
						"content": {
							"application/json": {
								"schema": {
									"oneOf": [
										{
											"$ref": "#/components/schemas/Purchase"
										},
										{
											"$ref": "#/components/schemas/Subscription"
										}
									]
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"409": {
						"$ref": "#/components/responses/E409"
					},
					"410": {
						"$ref": "#/components/responses/E410"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/your-server/"
				},
				"parameters": [
					{
						"name": "token",
						"in": "path",
						"required": true,
						"description": "The purchase token, pt_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/purchases/{token}/acknowledge": {
			"post": {
				"summary": "Say you delivered it, within 3 days, or it's refunded",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The purchase",
						"content": {
							"application/json": {
								"schema": {
									"oneOf": [
										{
											"$ref": "#/components/schemas/Purchase"
										},
										{
											"$ref": "#/components/schemas/Subscription"
										}
									]
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"409": {
						"$ref": "#/components/responses/E409"
					},
					"410": {
						"$ref": "#/components/responses/E410"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/your-server/"
				},
				"parameters": [
					{
						"name": "token",
						"in": "path",
						"required": true,
						"description": "The purchase token, pt_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/purchases/{token}/consume": {
			"post": {
				"summary": "A consumable is used up, so it can be bought again",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The purchase",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Purchase"
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"409": {
						"$ref": "#/components/responses/E409"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/your-server/"
				},
				"parameters": [
					{
						"name": "token",
						"in": "path",
						"required": true,
						"description": "The purchase token, pt_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/purchases/{token}/consumption": {
			"post": {
				"summary": "Your answer to a refund request",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "Received",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					},
					"409": {
						"$ref": "#/components/responses/E409"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/refunds/"
				},
				"parameters": [
					{
						"name": "token",
						"in": "path",
						"required": true,
						"description": "The purchase token, pt_...",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"customer_consented": {
										"const": true
									},
									"delivery": {
										"type": "string",
										"description": "",
										"enum": [
											"delivered",
											"undelivered_quality_issue",
											"undelivered_wrong_item",
											"undelivered_server_outage",
											"undelivered_other"
										]
									},
									"consumed_percent": {
										"type": "integer",
										"description": "Thousandths of a percent",
										"minimum": 0,
										"maximum": 100000
									},
									"sample_provided": {
										"type": "boolean"
									},
									"preference": {
										"type": "string",
										"description": "",
										"enum": [
											"approve",
											"approve_prorated",
											"decline",
											"neutral"
										]
									}
								},
								"required": [
									"customer_consented",
									"delivery",
									"sample_provided"
								]
							},
							"example": {
								"customer_consented": true,
								"delivery": "delivered",
								"consumed_percent": 25000,
								"sample_provided": false,
								"preference": "decline"
							}
						}
					}
				}
			}
		},
		"/v1/purchases/{token}/cancel": {
			"post": {
				"summary": "Stop a subscription renewing",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The subscription",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Subscription"
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"409": {
						"$ref": "#/components/responses/E409"
					},
					"410": {
						"$ref": "#/components/responses/E410"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/subscriptions/"
				},
				"parameters": [
					{
						"name": "token",
						"in": "path",
						"required": true,
						"description": "The purchase token, pt_...",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"type": {
										"type": "string",
										"description": "",
										"enum": [
											"stop_renewals",
											"stop_payments"
										]
									}
								},
								"required": [
									"type"
								]
							},
							"example": {
								"type": "stop_renewals"
							}
						}
					}
				}
			}
		},
		"/v1/purchases/{token}/revoke": {
			"post": {
				"summary": "End a subscription now and refund it",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The subscription",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Subscription"
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"409": {
						"$ref": "#/components/responses/E409"
					},
					"410": {
						"$ref": "#/components/responses/E410"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/subscriptions/"
				},
				"parameters": [
					{
						"name": "token",
						"in": "path",
						"required": true,
						"description": "The purchase token, pt_...",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"refund": {
										"type": "string",
										"description": "",
										"enum": [
											"full",
											"prorated"
										]
									}
								},
								"required": [
									"refund"
								]
							},
							"example": {
								"refund": "full"
							}
						}
					}
				}
			}
		},
		"/v1/orders": {
			"get": {
				"summary": "Your app's orders, newest first, 20 a page",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "A page of orders",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/your-server/#orders"
				},
				"parameters": [
					{
						"name": "product",
						"in": "query",
						"description": "A product ID",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "type",
						"in": "query",
						"description": "A product type",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "refunded",
						"in": "query",
						"description": "true or false",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "account_token",
						"in": "query",
						"description": "Your ID for the person",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "start",
						"in": "query",
						"description": "Milliseconds",
						"schema": {
							"type": "integer"
						}
					},
					{
						"name": "end",
						"in": "query",
						"description": "Milliseconds",
						"schema": {
							"type": "integer"
						}
					},
					{
						"name": "sort",
						"in": "query",
						"description": "ascending",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/orders/{order_id}": {
			"get": {
				"summary": "One order, by the order ID the buyer sees",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The order",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/Order"
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/your-server/#orders"
				},
				"parameters": [
					{
						"name": "order_id",
						"in": "path",
						"required": true,
						"description": "The order ID, NOS.1234-5678-9012-34567",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/orders/{order_id}/refund": {
			"post": {
				"summary": "Refund an order in full or in part, and take it back or not",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"204": {
						"description": "Refunded"
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					},
					"409": {
						"$ref": "#/components/responses/E409"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/refunds/"
				},
				"parameters": [
					{
						"name": "order_id",
						"in": "path",
						"required": true,
						"description": "The order ID, NOS.1234-5678-9012-34567",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "Idempotency-Key",
						"in": "header",
						"required": true,
						"description": "Letters, digits, - and _, up to 100. Use the same one to try again after a lost answer",
						"schema": {
							"type": "string",
							"pattern": "^[A-Za-z0-9_-]{1,100}$"
						}
					}
				],
				"requestBody": {
					"required": false,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"amount": {
										"type": "integer",
										"description": "Credits, less than what is left"
									},
									"quantity": {
										"type": "integer",
										"description": "Some of the quantity"
									},
									"revoke": {
										"type": "boolean",
										"description": "Take back what was bought. Default false"
									},
									"reason": {
										"type": "string",
										"description": "",
										"enum": [
											"other",
											"remorse",
											"not_received",
											"defective",
											"accidental_purchase",
											"fraud",
											"friendly_fraud",
											"chargeback"
										]
									}
								}
							},
							"example": {
								"amount": 100,
								"revoke": false
							}
						}
					}
				}
			}
		},
		"/v1/notifications": {
			"get": {
				"summary": "The notifications sent in the last 180 days, and how each went",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "20 a page, oldest first",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"400": {
						"$ref": "#/components/responses/E400"
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/notifications/"
				},
				"parameters": [
					{
						"name": "start",
						"in": "query",
						"description": "Milliseconds",
						"schema": {
							"type": "integer"
						}
					},
					{
						"name": "end",
						"in": "query",
						"description": "Milliseconds",
						"schema": {
							"type": "integer"
						}
					},
					{
						"name": "type",
						"in": "query",
						"description": "A notification type",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "purchase_token",
						"in": "query",
						"description": "A purchase token",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "cursor",
						"in": "query",
						"description": "next_cursor from the answer before",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		},
		"/v1/notifications/test": {
			"post": {
				"summary": "Send a test notification to your notifications address",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "The test's token",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"test_token": {
											"type": "string"
										}
									}
								},
								"example": {
									"test_token": "nt_..."
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"409": {
						"$ref": "#/components/responses/E409"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/notifications/"
				}
			}
		},
		"/v1/notifications/test/{test_token}": {
			"get": {
				"summary": "Whether that test arrived",
				"security": [
					{
						"salesKey": []
					}
				],
				"responses": {
					"200": {
						"description": "How it went",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"additionalProperties": true
								}
							}
						}
					},
					"401": {
						"$ref": "#/components/responses/E401"
					},
					"403": {
						"$ref": "#/components/responses/E403"
					},
					"404": {
						"$ref": "#/components/responses/E404"
					}
				},
				"tags": [
					"Selling"
				],
				"externalDocs": {
					"url": "https://accounts.nostrad.ai/developer/docs/selling/notifications/"
				},
				"parameters": [
					{
						"name": "test_token",
						"in": "path",
						"required": true,
						"description": "nt_...",
						"schema": {
							"type": "string"
						}
					}
				]
			}
		}
	}
}
