{"components":{"schemas":{"ApiAccessUnavailable":{"description":"The body of a 403.","properties":{"detail":{"title":"Detail","type":"string"}},"required":["detail"],"title":"ApiAccessUnavailable","type":"object"},"ApiTokenRefusal":{"description":"The body of every 401: the same detail whatever the reason.","properties":{"detail":{"title":"Detail","type":"string"}},"required":["detail"],"title":"ApiTokenRefusal","type":"object"},"BillingError":{"properties":{"detail":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}],"title":"Detail"}},"required":["detail"],"title":"BillingError","type":"object"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"HelloResponse":{"description":"Who the API token authenticated as. A way to check a token works.","properties":{"message":{"title":"Message","type":"string"},"org_id":{"title":"Org Id","type":"string"},"org_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Name"},"server_time":{"format":"date-time","title":"Server Time","type":"string"},"token_id":{"title":"Token Id","type":"string"},"token_name":{"title":"Token Name","type":"string"}},"required":["message","org_id","org_name","token_id","token_name","server_time"],"title":"HelloResponse","type":"object"},"RateLimitExceeded":{"description":"The body of a 429.","properties":{"detail":{"title":"Detail","type":"string"}},"required":["detail"],"title":"RateLimitExceeded","type":"object"},"TransactionResponse":{"description":"Credits drawn by one member's work. For a workspace on a current plan,\nthe credits drawn in one UTC day for one batch, generation or agent turn,\nso possibly several charges summed. For a workspace on legacy credits, one\ncharge.","properties":{"agent_turn_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set for `agent_tokens` charges, which have no batch or generation.","title":"Agent Turn Id"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"credit_type":{"description":"The kind of work that drew the credits: the tool's generation or batch type (for example `sketch_to_render`), `agent_tokens` for agent reasoning, or `retailer_readiness`. Legacy-credit workspaces report the credit ledger's coarser types (`onbody`, `animate`, `multiview`, `generate_model`, ...).","title":"Credit Type","type":"string"},"credits":{"description":"Credits drawn; always positive.","title":"Credits","type":"number"},"day":{"description":"The UTC day the credits were drawn.","format":"date","title":"Day","type":"string"},"generation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generation Id"},"id":{"description":"Stable: the same transaction keeps its id across reads.","title":"Id","type":"string"},"occurred_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"When the work was done: on a current plan the generation's creation time, else the batch's, else the agent turn's charge time; on legacy credits the charge time. Null when unknown.","title":"Occurred At"},"triggered_by":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`user` or `agent`.","title":"Triggered By"},"user":{"anyOf":[{"$ref":"#/components/schemas/TransactionUserResponse"},{"type":"null"}]}},"required":["id","day","occurred_at","credit_type","credits","user","triggered_by","batch_id","generation_id","agent_turn_id"],"title":"TransactionResponse","type":"object"},"TransactionUserResponse":{"description":"The member whose work drew the credits.","properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"id":{"title":"Id","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"required":["id","name","email"],"title":"TransactionUserResponse","type":"object"},"TransactionsRangeResponse":{"properties":{"from":{"format":"date","title":"From","type":"string"},"to":{"description":"Exclusive.","format":"date","title":"To","type":"string"}},"required":["from","to"],"title":"TransactionsRangeResponse","type":"object"},"TransactionsResponse":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Send as `cursor`, alone, for the next page. Null only when the range is exhausted: a page can be short or empty while this is set.","title":"Next Cursor"},"range":{"$ref":"#/components/schemas/TransactionsRangeResponse"},"transactions":{"description":"Newest first.","items":{"$ref":"#/components/schemas/TransactionResponse"},"title":"Transactions","type":"array"}},"required":["transactions","next_cursor","range"],"title":"TransactionsResponse","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}},"securitySchemes":{"ApiToken":{"description":"An org API token, created in Settings > API: `Bearer rsp_...`.","scheme":"bearer","type":"http"}}},"info":{"description":"Read your Raspberry workspace's data from your own systems.\n\n**Authentication.** Send an org API token, created by a workspace admin in Settings > API, as `Authorization: Bearer rsp_...`. A token that does not authenticate is always the same `401`, whatever the reason. The API is available on the Enterprise plan: a valid token of any other workspace answers `403`.\n\n**Rate limits.** Each token may make a fixed number of requests a minute across every route, 60 by default. Responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` while the limit is being counted (they are absent if counting is briefly unavailable, and requests are then admitted); over the limit the answer is `429` with `Retry-After`.\n\n**Errors** share one body shape, `{\"detail\": ...}`.\n\n**Versioning.** Changes within `v1` only add fields, parameters and routes. A breaking change ships under a new version root.","title":"Raspberry API","version":"v1"},"openapi":"3.1.0","paths":{"/api/external/v1/billing/transactions":{"get":{"description":"Who in the workspace spent how many credits, on what, and when, for a\nrange of UTC days, newest first. Charges only: credits added to the\nworkspace are not listed, and failed work is never charged.\n\nWorkspaces on a current plan report each member's credits per UTC day and\nper batch, generation or agent turn. Workspaces on legacy credits report\neach charge on its own, with no batch, generation or turn id.\n\nKeep requesting while `next_cursor` is not null. A page can hold fewer than\n`limit` transactions, or none, while more remain: each page walks a bounded\nnumber of days.","operationId":"list_billing_transactions_api_external_v1_billing_transactions_get","parameters":[{"description":"First UTC day, inclusive. Default: 30 days before `to`.","in":"query","name":"from","required":false,"schema":{"anyOf":[{"format":"date","type":"string"},{"type":"null"}],"description":"First UTC day, inclusive. Default: 30 days before `to`.","title":"From"}},{"description":"Last UTC day, exclusive. Default: 30 days after `from`, or tomorrow when neither is given, so today is included.","in":"query","name":"to","required":false,"schema":{"anyOf":[{"format":"date","type":"string"},{"type":"null"}],"description":"Last UTC day, exclusive. Default: 30 days after `from`, or tomorrow when neither is given, so today is included.","title":"To"}},{"description":"Transactions per page. Default 50.","in":"query","name":"limit","required":false,"schema":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"description":"Transactions per page. Default 50.","title":"Limit"}},{"description":"`next_cursor` from the previous page. Send it alone: it carries the range and page size of the request it continues.","in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page. Send it alone: it carries the range and page size of the request it continues.","title":"Cursor"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionsResponse"}}},"description":"Successful Response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingError"}}},"description":"The range is backwards or longer than 366 days, or the cursor is malformed, sent with a `from`, `to` or `limit` that differs from its own, or from before the workspace moved to a current plan."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenRefusal"}}},"description":"The API token is missing, malformed, unknown, revoked or expired. The response carries `WWW-Authenticate: Bearer`."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiAccessUnavailable"}}},"description":"The token is valid, but its workspace's plan does not include API access. The API is available on the Enterprise plan."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingError"}}},"description":"`billing_transactions_unavailable`: the workspace has a subscription but no billing account, so there is no history to read."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"}}},"description":"The token has used its requests for the current minute. `Retry-After` gives the seconds until the next window; every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (unix seconds)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingError"}}},"description":"Billing data could not be read; retry later."}},"security":[{"ApiToken":[]}],"summary":"List credit transactions"}},"/api/external/v1/hello":{"get":{"description":"Answers 200 with the org and token the request authenticated as, or 401\nfor any token that does not authenticate.","operationId":"hello_api_external_v1_hello_get","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HelloResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenRefusal"}}},"description":"The API token is missing, malformed, unknown, revoked or expired. The response carries `WWW-Authenticate: Bearer`."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiAccessUnavailable"}}},"description":"The token is valid, but its workspace's plan does not include API access. The API is available on the Enterprise plan."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceeded"}}},"description":"The token has used its requests for the current minute. `Retry-After` gives the seconds until the next window; every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (unix seconds)."}},"security":[{"ApiToken":[]}],"summary":"Check a token"}}}}