Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: postcache Credits API
version: 1.0.0
description: Public, short-lived media URLs for AI agents that post to Instagram, Threads and Facebook. Files are checked against the target platform's media rules; with convert, fixable files are converted in the background.
contact:
email: hello@postcache.dev
x-guidance: 'Upload an image or video for Instagram, Threads or a Facebook Page and get a public HTTPS URL that passes the platform''s media checks. PUT /v1/media with the file as the body and the X-Target header (instagram.feed, instagram.carousel, instagram.reels, instagram.story, threads, facebook.page), or POST /v1/media/from-url with {source_url, target}. Without an API key the first answer is 402: pay 0.01 USD in USDC (x402 on Base or MPP on Tempo) and repeat the request. Add dry_run=1 to check a file for free. Delete the file after posting with DELETE /v1/media/{id} and the x-delete-token from the answer.'
servers:
- url: https://postcache.dev
security:
- bearer: []
tags:
- name: Credits
paths:
/v1/credits:
post:
summary: Buy a credit pack (500 uploads for 5 USD)
operationId: buyCredits
security:
- bearer: []
- {}
description: Pay in USDC with MPP (Tempo) or x402 (Base). Without a key, creates an account with 500 credits and returns its API key once; with a key, adds 500 credits to that account.
requestBody:
required: false
content:
application/json:
schema:
type: object
properties: {}
description: No body needed
responses:
'200':
description: Credits added to the calling account
content:
application/json:
schema:
type: object
properties:
credits:
type: integer
payment:
type: object
properties:
protocol:
type: string
enum:
- x402
- mpp
method:
type: string
amount_usd:
type: string
reference:
type: string
'201':
description: 'New account: { key, credits, payment }'
content:
application/json:
schema:
type: object
properties:
key:
type: string
description: API key, shown once
credits:
type: integer
payment:
type: object
properties:
protocol:
type: string
enum:
- x402
- mpp
method:
type: string
amount_usd:
type: string
reference:
type: string
message:
type: string
'402':
description: 'Payment challenge (error: payment_required)'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: Payment already used
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
x-payment-info:
price:
mode: fixed
currency: USD
amount: '5.00'
protocols:
- x402: {}
- mpp:
method: tempo
intent: charge
currency: '0x20C000000000000000000000b9537d11c60E8b50'
tags:
- Credits
components:
schemas:
Error:
type: object
properties:
error:
type: string
message:
type: string
upgrade_url:
type: string
description: Where to change the plan (with quota_exceeded)
securitySchemes:
bearer:
type: http
scheme: bearer
description: pc_live_... early-access key
deleteToken:
type: apiKey
in: header
name: x-delete-token
description: One-time token from a pay-per-use upload answer; reads and deletes that one file