API Reference
Overview
The HashBin.org API provides programmatic access to content upload, metadata, and account management. All API requests must be made over HTTPS.
Base URL
Authentication
Programs authenticate with an API key, sent in either header:
Each key holds only the scopes you give it (for example content:write to publish, balance:read to read the balance) and can carry limits: a monthly spending limit, largest upload, longest retention, allowed content types, or specific CIDs. Anything else answers 403. Keys, apps, settings and deposits always need your own sign-in. Create and narrow keys from your dashboard; the full scope list is in docs/API.md.
For third-party browser integrations, use the hosted SDK at https://hashbin.org/sdk/hashbin.js and follow the SDK Guide. Raw files are served from 256t.us; see content security.
Authentication
Get current user session information (signed-in session only)
Response
List all API keys for authenticated user
Response
Create a new API key
Request Body
Response
Important: The key value is only shown once. Store it securely.
Balance
Get current wallet balance
Response
Content
Upload new content (requires authentication). The cost is deducted from your balance. Maximum upload size is 90 MB; larger requests get 413 Payload Too Large.
Send the raw bytes as the request body, or a multipart/form-data body with a content file field (and an optional retention_months field). The server computes the 256t hash.
Request
| Name | Where | Description |
|---|---|---|
| Content-Type | header | MIME type stored with the content (for raw bodies), or multipart/form-data |
| retention_months | query or form field | Whole months of retention, minimum 1 (default 1). OAuth clients always use the user's default retention. |
Response
Get content metadata, including the dedicated content URL
Parameters
| Parameter | Type | Description |
|---|---|---|
| cid | string | REQUIRED 256t content hash |
Response
Download raw content from the isolated content domain
Response
Binary content with the original content type and restrictive headers such as Content-Security-Policy: default-src 'none'; sandbox.
Check if content exists
Response
Error Responses
All errors follow a consistent format:
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Missing or invalid authentication |
| 402 | Payment Required - Insufficient balance |
| 404 | Not Found - Resource does not exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |