> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uapi.nl/llms.txt
> Use this file to discover all available pages before exploring further.

# /v1/perform

Executes complex, multi-step tasks across the web and local execution environment with a single request. `/v1/perform` can browse pages, call APIs, work with files, run code, and orchestrate multiple `/v1/extract` and `/v1/search` calls to return exactly what you asked for.

<Note>
  Availability: restricted beta. This endpoint is not yet covered by the official SDKs. To request access, email [contact@uapi.nl](mailto:contact@uapi.nl) with your account ID and intended use.
</Note>

## How it behaves

`/v1/perform` runs an agent with a bounded budget of internal calls.

* It may visit multiple URLs, follow links, render JavaScript, and call native site APIs where allowed.
* It can aggregate, transform, and filter data (for example: summarize docs, normalize tables, generate CSV/JSON).
* It can run short computations or scripts required to fulfill your instruction.
* It can internally use uAPI capabilities (including `/v1/extract` and `/v1/search`) as tools toward your goal.
* It stops when the task is complete or when it reaches your `max_calls` budget.

Each internal call counts as one billable call at your standard rate. If `max_calls` is 15 and the agent uses all of them, you are charged for 15 calls.

<Warning>
  This endpoint is powerful. Use clear, bounded instructions and set a sensible `max_calls` to control scope and cost.
</Warning>

## Parameters

<ParamField header="X-API-Key" type="string" required>
  API key used for authentication.
</ParamField>

<ParamField body="url" type="string">
  Optional starting URL. Use when the task should begin from a specific page.
</ParamField>

<ParamField body="query" type="string" required>
  Instruction describing what the agent should do, what to return, and in which format.
</ParamField>

<ParamField body="max_calls" type="integer">
  Optional hard limit on internal calls the agent may use. Defaults to 15 if omitted.
</ParamField>

## Make a request

This endpoint is currently not exposed as a first-class method in the official SDKs. Call it via plain HTTP (or via your HTTP client of choice) using your existing auth and retry strategy.

<CodeGroup>
  ```python Python (requests) theme={null}
  import os, requests

  API_KEY = os.environ["UAPI_API_KEY"]

  payload = {
    "url": "https://developers.google.com/maps",
    "query": "Research the official options for programmatically searching nearby places. Return a concise markdown summary with links to the relevant docs.",
    "max_calls": 8
  }

  r = requests.post(
    "https://api.uapi.nl/v1/perform",
    json=payload,
    headers={"X-API-Key": API_KEY},
    timeout=120
  )

  print(r.json())
  ```

  ```javascript Node.js (fetch) theme={null}
  import 'dotenv/config'
  import fetch from 'node-fetch'

  const API_KEY = process.env.UAPI_API_KEY

  const res = await fetch("https://api.uapi.nl/v1/perform", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": API_KEY
    },
    body: JSON.stringify({
      url: "https://openai.com/index",
      query: "Scan this page and linked official docs to list three concrete production use cases for uAPI-style extraction and return them as a JSON array with fields name, description, and source_url.",
      max_calls: 10
    })
  })

  const body = await res.json()
  console.log(body)
  ```

  ```bash cURL theme={null}
  curl -s -X POST "https://api.uapi.nl/v1/perform" \
    -H "X-API-Key: ${UAPI_API_KEY}" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://stripe.com/docs/payments/checkout",
      "query": "Identify the key parameters required to create a basic Stripe Checkout Session and return them as a minimal JSON schema with name, required, and description fields.",
      "max_calls": 12
    }'
  ```
</CodeGroup>

## Example: successful multi-step task

<ResponseExample>
  ```json 200 Success (truncated) theme={null}
  {
    "id": "7a6f4e9d-8d3b-4b41-9f4e-12b7c9f4d210",
    "success": true,
    "data": {
      "status": "completed",
      "summary": "Compiled a minimal schema for creating a Stripe Checkout Session.",
      "result_schema": [
        {
          "name": "mode",
          "required": true,
          "description": "Payment mode, e.g. 'payment' or 'subscription'."
        },
        {
          "name": "line_items",
          "required": true,
          "description": "Array of items with price and quantity."
        },
        {
          "name": "success_url",
          "required": true,
          "description": "URL to redirect after successful payment."
        },
        {
          "name": "cancel_url",
          "required": true,
          "description": "URL to redirect if the customer cancels."
        }
      ],
      "sources": [
        {
          "title": "Stripe Docs - Checkout Session",
          "url": "https://stripe.com/docs/api/checkout/sessions/create"
        }
      ],
      "calls_used": 6,
      "max_calls": 12
    },
    "error": null,
    "request": {
      "endpoint": "/v1/perform",
      "method": "POST",
      "params": {},
      "payload": {
        "url": "https://stripe.com/docs/payments/checkout",
        "query": "Identify the key parameters required to create a basic Stripe Checkout Session and return them as a minimal JSON schema with name, required, and description fields.",
        "max_calls": 12
      },
      "status_code": 200,
      "requested_at": "2025-11-08T12:40:37.292Z",
      "served_at": "2025-11-08T12:40:58.104Z",
      "elapsed_ms": 20812,
      "cache_info": {
        "is_cached": false,
        "cached_at": null,
        "expires_at": null
      }
    },
    "uapi_version": "1.2.5",
    "schema_version": "v1",
    "deprecation_warnings": []
  }
  ```
</ResponseExample>

## Example: beta restriction

<ResponseExample>
  ```json 403 Forbidden (beta only) theme={null}
  {
    "id": "4c2c6de4-0a7a-4b5a-8d3e-7f9bb2b3f901",
    "success": false,
    "data": null,
    "error": {
      "code": "BAD_CHANNEL",
      "message": "Your API key is on the release channel, but this endpoint is only available in the beta channel."
    },
    "request": {
      "endpoint": "/v1/perform",
      "method": "POST",
      "params": {},
      "payload": {
        "url": "https://stripe.com/docs/payments/checkout",
        "query": "Summarize the requirements."
      },
      "status_code": 403,
      "requested_at": "2025-11-08T12:41:10.000Z",
      "served_at": "2025-11-08T12:41:10.120Z",
      "elapsed_ms": 120,
      "cache_info": {
        "is_cached": false,
        "cached_at": null,
        "expires_at": null
      }
    },
    "uapi_version": "1.2.5",
    "schema_version": "v1",
    "deprecation_warnings": []
  }
  ```
</ResponseExample>

<Note>
  Use `/v1/perform` when you need a bounded, task-level result (e.g. “analyze, transform, and return X”), not just a single-page extraction. Keep instructions precise and set `max_calls` to the maximum you are comfortable spending for that task.
</Note>
