curl --request POST \
--url https://api.brandfetch.io/v2/agents/access \
--header 'PAYMENT-SIGNATURE: <api-key>'import requests
url = "https://api.brandfetch.io/v2/agents/access"
headers = {"PAYMENT-SIGNATURE": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'PAYMENT-SIGNATURE': '<api-key>'}};
fetch('https://api.brandfetch.io/v2/agents/access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brandfetch.io/v2/agents/access",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"PAYMENT-SIGNATURE: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.brandfetch.io/v2/agents/access"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("PAYMENT-SIGNATURE", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.brandfetch.io/v2/agents/access")
.header("PAYMENT-SIGNATURE", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brandfetch.io/v2/agents/access")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["PAYMENT-SIGNATURE"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"organization": {
"id": "<string>",
"urn": "urn:brandfetch:organization:xig9b54wddtihs0dktyhau0i"
},
"apiKey": {
"id": "<string>",
"key": "<string>",
"name": "Agent Key"
},
"apiClient": {
"clientId": "<string>"
},
"mcp": {
"url": "https://mcp.brandfetch.io/mcp",
"token": "<string>"
},
"credits": {
"granted": 20,
"balance": 20,
"creditsPerUsd": 20,
"usdPaid": 1,
"deduplicated": true
},
"usage": {
"authorization": "Bearer <key>",
"note": "<string>"
},
"topUp": {
"method": "POST",
"url": "<string>",
"note": "<string>"
},
"documentation": "https://docs.brandfetch.com/agents/overview"
}{
"organization": {
"id": "<string>",
"urn": "urn:brandfetch:organization:xig9b54wddtihs0dktyhau0i"
},
"apiKey": {
"id": "<string>",
"key": "<string>",
"name": "Agent Key"
},
"apiClient": {
"clientId": "<string>"
},
"mcp": {
"url": "https://mcp.brandfetch.io/mcp",
"token": "<string>"
},
"credits": {
"granted": 20,
"balance": 20,
"creditsPerUsd": 20,
"usdPaid": 1,
"deduplicated": true
},
"usage": {
"authorization": "Bearer <key>",
"note": "<string>"
},
"topUp": {
"method": "POST",
"url": "<string>",
"note": "<string>"
},
"documentation": "https://docs.brandfetch.com/agents/overview"
}{
"message": "usd must be a whole number of US dollars between 1 and 500."
}{
"message": "Payment required. Either authenticate with a Brandfetch API key (Authorization: Bearer <key>) or pay for this request with x402: sign the payment described in the PAYMENT-REQUIRED header and retry with a PAYMENT-SIGNATURE header.",
"documentation": "https://docs.brandfetch.com/agents/pay-per-request",
"pricing": {
"route": "GET /v2/brands/*",
"price": "$0.10"
},
"resource": "https://api.brandfetch.io/v2/brands/nike.com",
"standingAccess": "For many requests, POST /v2/agents/access (paid the same way) provisions an API key preloaded with prepaid credits."
}{
"message": "<string>",
"reason": "payment_in_progress",
"paymentReference": "<string>",
"organization": {
"id": "<string>",
"urn": "urn:brandfetch:organization:xig9b54wddtihs0dktyhau0i"
}
}{
"message": "Provisioning failed after your payment was accepted. Retry this exact request to receive your credential, or contact support with the payment reference.",
"paymentReference": "<string>"
}{
"message": "<string>",
"reason": "payment_outcome_unknown",
"paymentReference": "<string>"
}Buy agent access
Buy standing Brandfetch API access with an x402 or MPP payment through POST /v2/agents/access, and receive an organization, an API key with prepaid credits, and an MCP token.
curl --request POST \
--url https://api.brandfetch.io/v2/agents/access \
--header 'PAYMENT-SIGNATURE: <api-key>'import requests
url = "https://api.brandfetch.io/v2/agents/access"
headers = {"PAYMENT-SIGNATURE": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'PAYMENT-SIGNATURE': '<api-key>'}};
fetch('https://api.brandfetch.io/v2/agents/access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brandfetch.io/v2/agents/access",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"PAYMENT-SIGNATURE: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.brandfetch.io/v2/agents/access"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("PAYMENT-SIGNATURE", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.brandfetch.io/v2/agents/access")
.header("PAYMENT-SIGNATURE", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brandfetch.io/v2/agents/access")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["PAYMENT-SIGNATURE"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"organization": {
"id": "<string>",
"urn": "urn:brandfetch:organization:xig9b54wddtihs0dktyhau0i"
},
"apiKey": {
"id": "<string>",
"key": "<string>",
"name": "Agent Key"
},
"apiClient": {
"clientId": "<string>"
},
"mcp": {
"url": "https://mcp.brandfetch.io/mcp",
"token": "<string>"
},
"credits": {
"granted": 20,
"balance": 20,
"creditsPerUsd": 20,
"usdPaid": 1,
"deduplicated": true
},
"usage": {
"authorization": "Bearer <key>",
"note": "<string>"
},
"topUp": {
"method": "POST",
"url": "<string>",
"note": "<string>"
},
"documentation": "https://docs.brandfetch.com/agents/overview"
}{
"organization": {
"id": "<string>",
"urn": "urn:brandfetch:organization:xig9b54wddtihs0dktyhau0i"
},
"apiKey": {
"id": "<string>",
"key": "<string>",
"name": "Agent Key"
},
"apiClient": {
"clientId": "<string>"
},
"mcp": {
"url": "https://mcp.brandfetch.io/mcp",
"token": "<string>"
},
"credits": {
"granted": 20,
"balance": 20,
"creditsPerUsd": 20,
"usdPaid": 1,
"deduplicated": true
},
"usage": {
"authorization": "Bearer <key>",
"note": "<string>"
},
"topUp": {
"method": "POST",
"url": "<string>",
"note": "<string>"
},
"documentation": "https://docs.brandfetch.com/agents/overview"
}{
"message": "usd must be a whole number of US dollars between 1 and 500."
}{
"message": "Payment required. Either authenticate with a Brandfetch API key (Authorization: Bearer <key>) or pay for this request with x402: sign the payment described in the PAYMENT-REQUIRED header and retry with a PAYMENT-SIGNATURE header.",
"documentation": "https://docs.brandfetch.com/agents/pay-per-request",
"pricing": {
"route": "GET /v2/brands/*",
"price": "$0.10"
},
"resource": "https://api.brandfetch.io/v2/brands/nike.com",
"standingAccess": "For many requests, POST /v2/agents/access (paid the same way) provisions an API key preloaded with prepaid credits."
}{
"message": "<string>",
"reason": "payment_in_progress",
"paymentReference": "<string>",
"organization": {
"id": "<string>",
"urn": "urn:brandfetch:organization:xig9b54wddtihs0dktyhau0i"
}
}{
"message": "Provisioning failed after your payment was accepted. Retry this exact request to receive your credential, or contact support with the payment reference.",
"paymentReference": "<string>"
}{
"message": "<string>",
"reason": "payment_outcome_unknown",
"paymentReference": "<string>"
}402 with both challenges, pay one, and repeat the request with PAYMENT-SIGNATURE or Authorization: Payment …. Pay per request walks through it with code.Authorizations
An x402 payment for this one request: the signed payment for the challenge a bare request receives in its PAYMENT-REQUIRED header. Alternative to the bearer API key. See https://docs.brandfetch.com/agents/pay-per-request.
Query Parameters
When true on a top-up, issues a new key holding the combined balance, returned once like any other. The wallet's earlier keys stop working once the new key has been returned, even if the client never receives that response. If the rotation is answered with an error instead of the new key, they keep working. A retry answered 409 credential_already_delivered means the rotation completed: pay again with rotateKey=true for a new key.
Response
Topped up: the wallet already owned an organization. The credential is returned once, in this response.
Was this page helpful?