Coinbase Logo

Freepik Enables x402 for Creative APIs

October 16, 2025

TL;DR Developers and onchain agents can now generate and license Freepik visuals automatically, paying per use in USDC via x402.

Today, we're excited to share that Freepik has enabled x402 for AI image generation through their `/v1/x402/ai/mystic` endpoint. Developers and onchain agents can now programmatically generate images, pay in USDC on Base, and receive AI-generated content in a single automated flow.

This integration turns Freepik’s creative APIs into payment-aware endpoints, so AI agents and builders can transact without keys, invoices, or centralized billing systems. It’s a major step forward for agentic commerce, where autonomous agents can find, decide, and pay for digital assets entirely onchain.

Aly Khan (Head of Enterprise at Freepik) adds, "Agentic creativity without compromise is now on the blockchain. Freepik with x402 is becoming the first creative AI integrated into agentic workflows.This marks a new era where creativity, programmability, and Web3 meet without friction."

What’s New

Freepik provides APIs that let developers access and generate creative assets — like images, icons, and AI-made visuals. With x402, their AI generation API now speaks payments natively at the protocol layer.

When an API call arrives without payment or with insufficient funds, the endpoint returns an HTTP 402 Payment Required response. That response includes a machine-readable quote in USDC, along with metadata like rate cards, license type, and usage scope. Once the quoted payment is submitted on-chain, the original request is automatically retried and fulfilled; no webhooks, keys, or manual review required.

By integrating x402, Freepik replaces legacy API systems and prepaid credit models with a true pay-per-use service, enabling autonomous agents to generate images on-demand without upfront costs or complex workflows.

x402-Enabled Endpoints

Freepik's x402 integration currently focuses on AI image generation with native quoting and settlement via their ‘POST /v1/x402/ai/mystic’ endpoint.

Parameters like prompt, model, resolution, and aspect ratio are included in the request, with the response containing generated image URLs and metadata. This endpoint requires a valid Freepik API key for authentication.

Example x402 Request Flow

An on-chain agent posts an image generation request to /v1/x402/ai/mystic, for example:

The API responds with an HTTP 402 Payment Required containing a JSON quote such as:

The agent wallet then pays the quoted amount in USDC on Base. Once confirmed, the API replays the original request and returns the generated image with metadata.

Why It Matters

The Freepik integration extends x402 into a new vertical: creative content APIs. For the x402 ecosystem, developers and agents can now license and generate content autonomously, paying per request with full transparency. And instead of scraping or relying on free tiers, agents can access licensed assets cleanly, with explicit terms and onchain receipts.

This is also a breakthrough for digital asset pricing. Every x402 quote includes a deterministic hash to prevent price drift. Agents echo this hash when paying to ensure one-to-one matching between the quote and the payment. Fulfillment is also idempotent: resubmitting the same request with the same token produces identical results and prevents double-spend.

If fulfillment fails after payment, the endpoint returns a 402.refund_suggested response, including a refund address or credit note. Rate limits are enforced by wallet proofs in the 402 payload - bursts are priced, not blocked.

Each licensed asset returns a provenance artifact containing the asset hash, wallet address, transaction hash, scope, and timestamp, giving agents a verifiable license record.

Architecture Overview

Freepik’s x402 integration runs on a simple but powerful pipeline:

  • An edge gateway detects unpaid requests, stamps quotes, and returns 402 responses.

  • A Base payment listener validates transaction hashes, quote signatures, and idempotency tokens.

  • A fulfillment worker replays the original request, attaches license artifacts, and streams results.

  • An audit and receipts service logs both on-chain and off-chain artifacts, ensuring traceability and compliance.

Try It Out

Developers can start experimenting today:

  • Direct Freepik x402 API: AI Generation: POST /v1/x402/ai/mystic (requires Freepik API key)

  • Required Setup:

  • Example Request:

```bash

curl -X POST "https://api.freepik.com/v1/x402/ai/mystic" \

-H "Content-Type: application/json" \

-H "x-freepik-api-key: YOUR_API_KEY" \

-d '{

"prompt": "a serene mountain lake at sunset",

"model": "realism",

"resolution": "1k",

"aspect_ratio": "square"

}'

With x402, Freepik's AI generation tools become on-demand, pay-as-you-go building blocks for the agentic web. AI-generated content is now just one transaction away.

Download the App

Google Play app store
Apple app store