{"openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": {"/service/v1/balance": {"get": {"tags": ["Balance"], "summary": "Get Balance", "description": "Get the authenticated organization's prepaid credit balance", "operationId": "get_balance_service_v1_balance_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BalanceResponse"}}}}}, "security": [{"BearerAuth": []}]}}, "/service/v1/balance/add": {"post": {"tags": ["Balance"], "summary": "Add to Balance", "description": "Charge the organization's default payment method and add the amount to the prepaid credit balance. The default payment method configured on the org's Stripe customer is always used; no payment method id is accepted from the client.", "operationId": "add_balance_service_v1_balance_add_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/AddBalanceRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BalanceResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"BearerAuth": []}]}}, "/service/v1/apps": {"get": {"tags": ["Apps"], "summary": "List Apps", "description": "List all apps for the authenticated organization", "operationId": "list_apps_service_v1_apps_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GetAppsForOrgResponseModel"}}}}}, "security": [{"BearerAuth": []}]}, "post": {"tags": ["Apps"], "summary": "Create App", "description": "Create a new app for the authenticated organization", "operationId": "create_app_service_v1_apps_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateAppRequestModel"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateAppResponseModel"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"BearerAuth": []}]}}, "/service/v1/apps/{app_id}": {"delete": {"tags": ["Apps"], "summary": "Delete App", "description": "Delete an app from the authenticated organization", "operationId": "delete_app_service_v1_apps__app_id__delete", "parameters": [{"name": "app_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "App Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"BearerAuth": []}]}}, "/service/v1/apps/{app_id}/keys": {"post": {"tags": ["Keys"], "summary": "Create Key", "description": "Create a new API key for an app", "operationId": "create_key_service_v1_apps__app_id__keys_post", "parameters": [{"name": "app_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "App Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateApiKeyRequestModel"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateKeyResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"BearerAuth": []}]}}, "/service/v1/apps/{app_id}/keys/{api_key_id}": {"delete": {"tags": ["Keys"], "summary": "Delete Key", "description": "Delete an API key from an app", "operationId": "delete_key_service_v1_apps__app_id__keys__api_key_id__delete", "parameters": [{"name": "app_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "App Id"}}, {"name": "api_key_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Api Key Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"BearerAuth": []}]}}}, "components": {"schemas": {"CreateAppRequestModel": {"properties": {"app_name": {"type": "string", "title": "App Name", "description": "App name"}}, "type": "object", "required": ["app_name"], "title": "CreateAppRequestModel", "description": "Model for creating app request."}, "AddBalanceRequest": {"properties": {"amount_cents": {"type": "integer", "maximum": 10000.0, "exclusiveMinimum": 0.0, "title": "Amount Cents", "description": "Amount in cents to charge and add to the balance. Must be between 1 and 10000 cents ($100.00)."}, "idempotency_key": {"type": "string", "maxLength": 128, "minLength": 8, "title": "Idempotency Key", "description": "Required idempotency key. Stripe dedupes the charge server-side for at least 24h when the same key is submitted again for the same org (see https://docs.stripe.com/api/idempotent_requests). Pick a high-entropy value (e.g. a UUID) so distinct agent attempts do not collide."}}, "type": "object", "required": ["amount_cents", "idempotency_key"], "title": "AddBalanceRequest", "description": "Request to charge the org's default payment method and add to balance."}, "BalanceResponse": {"properties": {"org_id": {"type": "string", "title": "Org Id", "description": "Organization ID"}, "credit_balance_cents": {"type": "number", "title": "Credit Balance Cents", "description": "Total available prepaid balance in cents (credits + prepaid commits). Always 0 when will_invoice is true."}, "pending_debit_balance_cents": {"type": "number", "title": "Pending Debit Balance Cents", "description": "Balance in cents currently held for inflight tasks plus charges not yet synced to the billing provider. Always 0 when will_invoice is true."}, "will_invoice": {"type": "boolean", "title": "Will Invoice", "description": "True if this organization is billed by invoice (postpaid) rather than from a prepaid credit balance. Invoice-only orgs cannot add balance via this API."}}, "type": "object", "required": ["org_id", "credit_balance_cents", "pending_debit_balance_cents", "will_invoice"], "title": "BalanceResponse", "description": "Balance response for service clients."}, "CreateApiKeyRequestModel": {"properties": {"api_key_name": {"type": "string", "title": "Api Key Name", "description": "API Key Name"}}, "type": "object", "required": ["api_key_name"], "title": "CreateApiKeyRequestModel", "description": "Model for create API key request V2."}, "GetAppsForOrgResponseModel": {"properties": {"apps": {"items": {"$ref": "#/components/schemas/AppItem"}, "type": "array", "title": "Apps", "description": "List of apps"}}, "type": "object", "required": ["apps"], "title": "GetAppsForOrgResponseModel", "description": "Model for getting apps for organization response."}, "AppItem": {"properties": {"app_name": {"type": "string", "title": "App Name", "description": "App name"}, "org_name": {"type": "string", "title": "Org Name", "description": "Organization name"}, "app_id": {"type": "string", "title": "App Id", "description": "App ID"}, "org_id": {"type": "string", "title": "Org Id", "description": "Organization ID"}}, "type": "object", "required": ["app_name", "org_name", "app_id", "org_id"], "title": "AppItem", "description": "Model for an application item."}, "CreateKeyResponse": {"properties": {"api_key_id": {"type": "string", "title": "Api Key Id", "description": "API Key ID"}, "api_key_name": {"type": "string", "title": "Api Key Name", "description": "API Key Name"}, "app_id": {"type": "string", "title": "App Id", "description": "App ID"}, "app_name": {"type": "string", "title": "App Name", "description": "App Name"}, "created_by_user_id": {"type": "string", "title": "Created By User Id", "description": "Created by User ID"}, "created_by_user_email": {"type": "string", "title": "Created By User Email", "description": "Created by User Email"}, "display_value": {"type": "string", "title": "Display Value", "description": "Display Value"}, "raw_api_key": {"type": "string", "format": "password", "title": "Raw Api Key", "description": "Raw API Key", "writeOnly": true}, "created_at": {"type": "integer", "title": "Created At", "description": "Created At"}}, "type": "object", "required": ["api_key_id", "api_key_name", "app_id", "app_name", "created_by_user_id", "created_by_user_email", "display_value", "raw_api_key", "created_at"], "title": "CreateKeyResponse", "description": "Flattened response for the service create-key endpoint."}, "CreateAppResponseModel": {"properties": {"app_id": {"type": "string", "title": "App Id", "description": "App ID"}}, "type": "object", "required": ["app_id"], "title": "CreateAppResponseModel", "description": "Model for creating app response."}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}, "securitySchemes": {"BearerAuth": {"type": "http", "scheme": "bearer", "bearerFormat": "JWT", "description": "Send `Authorization: Bearer <access_token>`. This must be an account API access token minted via Parallel's OAuth device flow, not a standard API key. See the [account API docs](/integrations/account-api)."}}}, "servers": [{"url": "https://api.parallel.ai/account", "description": "Parallel Account API"}], "tags": [{"name": "Apps", "description": "Application management endpoints"}, {"name": "Keys", "description": "API key management endpoints"}, {"name": "Balance", "description": "Organization balance endpoints"}, {"name": "Service", "description": "Service utility endpoints"}]}