> This page is for version 2025-11-27 (default).
> For other versions, use one of these documentation indexes:
> - 2025-11-27 (default): https://docs.caesar.xyz/2025-11-27/llms.txt
> - 2025-08-08: https://docs.caesar.xyz/2025-08-08/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.caesar.xyz/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.caesar.xyz/_mcp/server.

# Create a Research Object via x402

POST https://api.caesar.xyz/x402/research
Content-Type: application/json

Start a new research job using x402 payment. This endpoint mints a temporary API key that is returned in the response and is billed via the x402 settlement flow instead of your Caesar API credits.

Reference: https://docs.caesar.xyz/api-reference/api-reference/payments/create-research-object-x-402

## Request

### Headers

- `X-PAYMENT` (string, required) — Base64-encoded x402 payment payload.

### Body (application/json)

This endpoint expects a CreateResearchX402Request.

- `query` (string, required) — Primary research question or instruction.
- `reasoning_loops` (integer, optional, default: 1) — Maximum number of iterative reasoning cycles the research process can perform.
- `source_timeout` (integer, optional, default: 60) — Maximum time in seconds to wait when fetching content from each source URL.
- `reasoning_mode` (boolean, optional, default: false) — When enabled, uses an advanced reasoning model for deeper analysis.
- `allow_early_exit` (boolean, optional, default: false) — When enabled, the research process may complete before exhausting all reasoning loops.
- `exclude_social` (boolean, optional, default: false) — When enabled, excludes results from social media platforms.
- `excluded_domains` (list of string, optional) — List of domains to exclude from search results (e.g., "example.com"). Subdomains are also excluded.
- `auto` (boolean, optional, default: false) — When enabled, activates auto mode which analyzes the query to determine optimal configuration.
- `system_prompt` (string, optional) — Custom system prompt to guide the research synthesis.
- `model` (string, optional) — Preferred AI model to use for research synthesis. Valid values are "gpt-5.2", "gemini-3-pro", "gemini-3.1-pro", "gemini-3-flash", or "claude-opus-4.5". When not specified, the system automatically selects an appropriate model.

## Response

### 200

Research job accepted and x402 payment settled.

- `id` (string, required) — Research job identifier.
- `status` (enum, required) — Current status of the research job: - `queued`: Job accepted, waiting to start - `searching`: Gathering sources from the web - `researching`: Processing and analyzing sources - `analyzing`: Deep analysis of gathered information - `summarizing`: Generating final synthesis - `completed`: Research finished successfully - `failed`: Research encountered an error
  - Allowed values: `queued`, `searching`, `summarizing`, `analyzing`, `completed`, `failed`, `researching`
- `api_key_secret` (string, optional) — Temporary API key secret created for this x402 request.

## Errors

### 400 Bad Request Error

Bad request — invalid input parameters.

- `error` (string, required) — Human-readable error description.

### 402 Payment Required Error

Payment required — x402 payment is missing or invalid.

- `error` (string, required) — Human-readable error description.

### 500 Internal Server Error

Internal server error.

- `error` (string, required) — Human-readable error description.

## Examples

**Request**

```json
{
  "query": "What are the latest advancements in renewable energy technologies?"
}
```

**Response**

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "queued",
  "api_key_secret": "sk_temp_4f8b9c7d2e1a4b6f9d8e7c3a5b1f2d0e"
}
```

**SDK Code**

```python
import requests

url = "https://api.caesar.xyz/x402/research"

payload = { "query": "What are the latest advancements in renewable energy technologies?" }
headers = {
    "X-PAYMENT": "X-PAYMENT",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.caesar.xyz/x402/research';
const options = {
  method: 'POST',
  headers: {'X-PAYMENT': 'X-PAYMENT', 'Content-Type': 'application/json'},
  body: '{"query":"What are the latest advancements in renewable energy technologies?"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.caesar.xyz/x402/research"

	payload := strings.NewReader("{\n  \"query\": \"What are the latest advancements in renewable energy technologies?\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-PAYMENT", "X-PAYMENT")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.caesar.xyz/x402/research")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-PAYMENT"] = 'X-PAYMENT'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"query\": \"What are the latest advancements in renewable energy technologies?\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.caesar.xyz/x402/research")
  .header("X-PAYMENT", "X-PAYMENT")
  .header("Content-Type", "application/json")
  .body("{\n  \"query\": \"What are the latest advancements in renewable energy technologies?\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.caesar.xyz/x402/research', [
  'body' => '{
  "query": "What are the latest advancements in renewable energy technologies?"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-PAYMENT' => 'X-PAYMENT',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.caesar.xyz/x402/research");
var request = new RestRequest(Method.POST);
request.AddHeader("X-PAYMENT", "X-PAYMENT");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"query\": \"What are the latest advancements in renewable energy technologies?\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-PAYMENT": "X-PAYMENT",
  "Content-Type": "application/json"
]
let parameters = ["query": "What are the latest advancements in renewable energy technologies?"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.caesar.xyz/x402/research")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```