← Back to blog

Free Pastebin API: Create Pastes with curl, Python, or an AI Agent

Published July 11, 2026 · Updated August 4, 2026 · Eric · 6 min read

Quick answer

Free Pastebin API: send content to POST /api/paste and get a shareable page URL plus a raw-text URL. No account or API key for basic use. Up to 500 KB per paste.

Create a paste in your browser → · API docs →

Need a pastebin API that works from a single curl command—or from Claude, ChatGPT, Hermes, or n8n—without signing up for a developer portal? Agent Media Tools exposes POST /api/paste so you can create pastes for logs, code, prompts, and agent intermediate results in one request.

This guide covers the free API contract, curl and Python examples, how AI agents use pastes as ephemeral memory, and how to fetch raw text after create.

Why a Programmable Pastebin?

Most paste sites want a browser session. A zero-auth REST pastebin is better when you are already in a terminal or automation loop:

API Overview

PropertyValue
EndpointPOST /api/paste
Content-Typeapplication/json
Required fieldcontent (string, up to 500 KB)
Optional fieldstitle, syntax, expires_in_hours, is_public
ResponseJSON with slug, url, and raw_url
AuthNot required for basic create
Max size500 KB per paste

Create is always a POST with a JSON body. That is the standard REST pattern (there is no public “create paste with GET”). After create, you read content with GET on the page or raw_url.

curl — Create a Paste in One Command

💡 Windows users: Run these from Git Bash or WSL — PowerShell's curl is an alias for Invoke-WebRequest.

Simple text paste

curl -X POST https://agentmediatools.com/api/paste \
  -H "Content-Type: application/json" \
  -d '{"content": "Hello from an AI agent! This paste was created via curl."}'

Example response:

{
  "success": true,
  "slug": "aB3xK9mP2q",
  "url": "https://agentmediatools.com/p/aB3xK9mP2q",
  "raw_url": "https://agentmediatools.com/p/aB3xK9mP2q/raw"
}

Share url for a readable page; use raw_url for plain text in scripts.

Syntax highlighting and expiration

curl -X POST https://agentmediatools.com/api/paste \
  -H "Content-Type: application/json" \
  -d '{
    "content": "def hello(name):\n    print(f\"Hello, {name}!\")",
    "title": "Python hello world",
    "syntax": "python",
    "expires_in_hours": 24
  }'

Paste a log file

CONTENT=$(python3 -c "import json,sys; print(json.dumps(sys.stdin.read()))" < deploy.log)
curl -X POST https://agentmediatools.com/api/paste \
  -H "Content-Type: application/json" \
  -d "{\"content\": $CONTENT, \"title\": \"Deploy Log\", \"syntax\": \"text\"}"

Fetch Raw Paste Text (GET)

After create, retrieve plain text without HTML:

curl -s https://agentmediatools.com/p/aB3xK9mP2q/raw

That is the usual answer when someone wants “pastebin get API” behavior: create with POST, read with GET on /raw.

Python Examples

import requests

resp = requests.post(
    "https://agentmediatools.com/api/paste",
    json={
        "content": "Hello from Python!",
        "title": "Python test paste",
        "syntax": "text",
    },
)
data = resp.json()
print(data["url"], data["raw_url"])

# Later: fetch raw body
print(requests.get(data["raw_url"]).text)

Using the Pastebin API with AI Agents

Claude, ChatGPT, Hermes, and similar agents can treat the pastebin as ephemeral memory—store long outputs, then pass short URLs between steps.

Agent workflow: summarize and store

  1. Extract document text via PDF to text or OCR
  2. Generate a summary
  3. POST the summary to /api/paste
  4. Return the paste URL to the user

Agent workflow: debug log handoff

  1. Capture stack traces or tool errors
  2. Create a paste with syntax: "text"
  3. Share the URL instead of truncating the chat

MCP: create_paste for Claude Desktop / Cursor

With the Agent Media Tools MCP server, ask in natural language:

"Take this error log and create a paste I can share with my team."

MCP exposes the create_paste tool so the model builds the JSON, calls the API, and returns the URL.

Comparison: Agent Media Tools vs Typical Pastebins

FeatureAgent Media ToolsMany pastebin sites
API authNone required for basic createAPI key or login
curl-friendlySingle POSTOften cookies / form tokens
Raw text URLYes (raw_url)Varies
ExpirationOptional hoursCoarse presets
MCP / agentsBuilt-in create_pasteUsually none

FAQ

Is the Pastebin API free?

Yes for basic use—no signup or API key—subject to current free-tier daily limits. See pricing for plan limits.

Can I create a paste without a POST body?

Create requires POST with JSON content. Reading an existing paste uses GET on /p/{slug} or /p/{slug}/raw.

Do pastes expire?

Set expires_in_hours when creating. Expired pastes return 410 Gone and are cleaned up.

Is there a browser UI?

Yes: free online pastebin tool on Agent Media Tools.

Related tools

Interactive: create a paste now

No account required. Paste text below and get a shareable URL in one click.

Free now · durable when you need it

Basic pastes are free and great for ephemeral agent memory. Need longer retention, private pastes, or durable Artifacts for production agents? Founding Pro ($4.99/mo) and Artifacts keep results available beyond short free TTLs.

→ Full pastebin tool  ·  API Docs  ·  Discord

Tags: free pastebin API, pastebin API curl, AI agent memory, create paste REST, raw paste URL, MCP create_paste

Related: Create a paste → · QR codes → · All tools →