{"openapi":"3.1.0","x-deprecation-policy":{"versioning":"API-Version header (current: 1)","deprecationSignal":"Sunset response header on affected operations","minimumNotice":"Deprecated operations remain supported for at least 180 days after the replacement ships.","policyUrl":"https://anytourl.com/docs/api-versioning"},"info":{"title":"AnyToURL API","summary":"Upload files, create text pastes, and shorten URLs into shareable links.","description":"AnyToURL turns files, text, and long URLs into instantly shareable links served from a global edge network. Authenticate with an API key from Settings → API Keys, sent as `Authorization: Bearer <key>` or `x-api-key: <key>`. All responses use a stable JSON envelope: `{ code, message, success, error?, data? }` and echo the served API version in the `API-Version` response header.\n\nVersioning policy: the API is versioned via the `API-Version` header (current: `1`). Version 1 is stable; breaking changes ship as version 2 under the same paths. Deprecations are signalled with a `Sunset` response header on the affected operations and remain supported for at least 180 days after the replacement ships.","version":"1.0.0","contact":{"name":"AnyToURL Support","email":"support@anytourl.com","url":"https://anytourl.com/contact"}},"servers":[{"url":"https://anytourl.com"}],"security":[{"apiKey":[]}],"paths":{"/api/storage/upload-file":{"post":{"operationId":"uploadFile","summary":"Upload a single file","description":"Uploads one file (up to 32 MiB through this endpoint) and returns the shareable URL(s). Uses `Authorization: Bearer <key>` or `x-api-key: <key>`. Multipart upload for larger files is documented separately.","tags":["Files"],"security":[{"apiKey":[]}],"parameters":[{"name":"API-Version","in":"header","required":false,"schema":{"type":"string"},"description":"Requested API version. Omit or set to `1` for the current stable surface. The server always echoes the served version in the `API-Version` response header."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"string","format":"binary","description":"The file to upload (one file per request)."}}}}}},"responses":{"200":{"description":"Upload succeeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiEnvelope"}}}},"400":{"description":"Invalid request (validation, policy, or quota error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large (upload exceeds the proxy limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/storage/upload-image":{"post":{"operationId":"uploadImage","summary":"Upload one or more images","description":"Uploads image files (`files` array in multipart form data) and returns their shareable URLs. Rate-limited per API key.","tags":["Files"],"parameters":[{"name":"API-Version","in":"header","required":false,"schema":{"type":"string"},"description":"Requested API version. Omit or set to `1` for the current stable surface. The server always echoes the served version in the `API-Version` response header."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"Image files to upload."}}}}}},"responses":{"200":{"description":"Upload succeeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiEnvelope"}}}},"400":{"description":"Invalid request (validation, policy, or quota error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/text/create":{"post":{"operationId":"createTextPaste","summary":"Create a text paste","description":"Turns text content into a browser-accessible shareable paste link. Content is limited to 6 MiB.","tags":["Pastes"],"parameters":[{"name":"API-Version","in":"header","required":false,"schema":{"type":"string"},"description":"Requested API version. Omit or set to `1` for the current stable surface. The server always echoes the served version in the `API-Version` response header."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"The text to paste."},"title":{"type":"string","description":"Optional title used as the paste filename."}}}}}},"responses":{"200":{"description":"Paste created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiEnvelope"}}}},"400":{"description":"Invalid request (validation, policy, or quota error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/url/create":{"post":{"operationId":"shortenUrl","summary":"Shorten a URL","description":"Shortens a long HTTP or HTTPS URL into a shareable short link. The original URL must be valid and reachable.","tags":["Links"],"parameters":[{"name":"API-Version","in":"header","required":false,"schema":{"type":"string"},"description":"Requested API version. Omit or set to `1` for the current stable surface. The server always echoes the served version in the `API-Version` response header."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"The long URL to shorten."}}}}}},"responses":{"200":{"description":"Short link created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiEnvelope"}}}},"400":{"description":"Invalid request (validation, policy, or quota error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/file/short-link":{"post":{"operationId":"assignShortLink","summary":"Assign a short link to an owned file","description":"Assigns a generated or custom short code to a file you own, and returns the short URL. Requires an account with short-link entitlement.","tags":["Links"],"parameters":[{"name":"API-Version","in":"header","required":false,"schema":{"type":"string"},"description":"Requested API version. Omit or set to `1` for the current stable surface. The server always echoes the served version in the `API-Version` response header."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"The owned file URL to assign a short link to."}}}}}},"responses":{"200":{"description":"Short link assigned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiEnvelope"}}}},"400":{"description":"Invalid request (validation, policy, or quota error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credits":{"get":{"operationId":"getCredits","summary":"Get credit balance and history","description":"Returns the authenticated user's credit balance and recent credit history. Requires a session cookie (used by the web app), not an API key.","tags":["Account"],"security":[],"parameters":[{"name":"API-Version","in":"header","required":false,"schema":{"type":"string"},"description":"Requested API version. Omit or set to `1` for the current stable surface. The server always echoes the served version in the `API-Version` response header."}],"responses":{"200":{"description":"Balance and history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiEnvelope"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/config/public":{"get":{"operationId":"getPublicConfig","summary":"Get public site configuration","description":"Returns public, non-sensitive configuration such as plan limits and feature flags for the current environment.","tags":["Configuration"],"security":[],"parameters":[{"name":"API-Version","in":"header","required":false,"schema":{"type":"string"},"description":"Requested API version. Omit or set to `1` for the current stable surface. The server always echoes the served version in the `API-Version` response header."}],"responses":{"200":{"description":"Public configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiEnvelope"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/token":{"get":{"operationId":"getSessionToken","summary":"Get the current session token","description":"Returns the authenticated user's session token and cookie name. Used by the desktop client auth-callback flow; requires a session cookie.","tags":["Account"],"security":[],"parameters":[{"name":"API-Version","in":"header","required":false,"schema":{"type":"string"},"description":"Requested API version. Omit or set to `1` for the current stable surface. The server always echoes the served version in the `API-Version` response header."}],"responses":{"200":{"description":"Session token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiEnvelope"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"parameters":{"APIVersion":{"name":"API-Version","in":"header","required":false,"schema":{"type":"string"},"description":"Requested API version. Omit or set to `1` for the current stable surface. The server always echoes the served version in the `API-Version` response header."}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"AnyToURL API key from Settings → API Keys. Also accepted via the `x-api-key` header."}},"schemas":{"ApiEnvelope":{"type":"object","description":"Standard response envelope for every AnyToURL API endpoint.","properties":{"code":{"type":"integer","description":"0 on success, -1 on error."},"message":{"type":"string","description":"Human-readable status message."},"success":{"type":"boolean","description":"true on success, false on error."},"error":{"type":"string","description":"Present when success is false; mirrors message."},"data":{"description":"Payload for the operation. Shape varies per endpoint."}}},"ApiError":{"type":"object","description":"Typed error body returned on 4xx/5xx responses. Always carries a stable envelope so agents can branch without parsing prose.","required":["code","message","success","error"],"properties":{"code":{"type":"integer","description":"0 on success, -1 on error."},"message":{"type":"string","description":"Human-readable status message."},"success":{"type":"boolean","const":false,"description":"Always false for error responses."},"error":{"type":"string","description":"Machine-oriented error message; mirrors message."},"retryAfterSeconds":{"type":"integer","description":"Present on 429 responses; seconds to wait before retrying."}}}},"responses":{"Unauthorized":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"ClientError":{"description":"Invalid request (validation, policy, or quota error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"ServerError":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}