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

# Resolve Config

Use this API to resolve optimal extraction strategies and execution strategy for an agent based on its instructions. The engine analyzes the (optional `rawInstructions` plus the processed `instructions`) and returns:

* A recommended set of `contextGathering.strategies`
* A recommended `executionStrategy` (`ai`, `service`, `service+ai`, or `stagehand-agent`)
* Per-strategy options where a recommended strategy needs them
* Reasoning for each recommendation

Use this as a starting point when creating a new agent; the response can be passed straight into [Create Agent](/docs/api-reference/rest-apis/v2/agents/create) under the `contextGathering` and `execution` blocks.

# Endpoint

`POST https://api.velt.dev/v2/agents/config/resolve`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/docs/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="instructions" type="string" required>
      Min 1 char. The processed/enhanced agent instructions.
    </ParamField>

    <ParamField body="rawInstructions" type="string">
      Verbatim user prompt. When provided, the resolver also uses it to detect navigation/interaction intent (e.g. "click the menu, then check…") and may recommend `stagehand-agent` execution.
    </ParamField>

    <ParamField body="provider" type="string">
      LLM provider override: `"gemini"`, `"claude"`, or `"openai"`. Any other value is accepted by the request schema, but the resolver then fails internally and returns its hardcoded default recommendation under a `success` status. Omit the field to use the platform default.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### 1. Resolve a static analysis agent

```JSON theme={null}
{
  "data": {
    "instructions": "Verify all CTAs use the primary brand color #1A73E8 and the heading font 'Inter'."
  }
}
```

#### 2. Resolve an interactive agent

```JSON theme={null}
{
  "data": {
    "rawInstructions": "Open the navigation menu, click 'Pricing', and check that the page title contains 'Pricing'.",
    "instructions": "Open the navigation menu, click the Pricing link, and verify the resulting page title contains 'Pricing'."
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Config resolved successfully",
    "data": {
      "resolvedConfig": {
        "extraction_strategies": ["web-page-text", "web-page-screenshot", "computed-styles"],
        "execution_strategy": "ai",
        "reasoning": "The instructions describe a static visual + textual check (brand colors and fonts). Screenshots support color verification; computed styles resolve the rendered font on the heading elements. AI execution is sufficient; no service delegation needed.",
        "strategy_options": {
          "computed-styles": {
            "selectors": ["h1", ".cta"]
          }
        }
      }
    }
  }
}
```

| Field                                       | Type      | Description                                                                                                                                                                                                                               |
| ------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data.resolvedConfig.extraction_strategies` | string\[] | Recommended `contextGathering.strategies` values.                                                                                                                                                                                         |
| `data.resolvedConfig.execution_strategy`    | string    | Recommended `execution.executionStrategy` value.                                                                                                                                                                                          |
| `data.resolvedConfig.reasoning`             | string    | Explanation for the recommendations.                                                                                                                                                                                                      |
| `data.resolvedConfig.strategy_options`      | object    | Per-strategy config the resolver derived from the prompt. Today the only key emitted is `computed-styles` (`{ selectors, properties? }`). Maps to `contextGathering.strategyOptions`. Omitted when no recommended strategy needs options. |

<Warning>
  Carry `strategy_options` across to Create Agent along with `extraction_strategies`. Some strategies are inert without it: `computed-styles` requires a `selectors` list, and dropping the resolver's options silently produces an agent that gathers nothing for that strategy.
</Warning>

Mapping the response onto [Create Agent](/docs/api-reference/rest-apis/v2/agents/create):

| Resolver field          | Create Agent field                 |
| ----------------------- | ---------------------------------- |
| `extraction_strategies` | `contextGathering.strategies`      |
| `strategy_options`      | `contextGathering.strategyOptions` |
| `execution_strategy`    | `execution.executionStrategy`      |

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

**Errors:** `INVALID_ARGUMENT` (missing or empty `instructions`).

<Warning>
  The resolver never surfaces an AI failure as an error. If the model call fails for any reason, the endpoint still returns `200` with `"status": "success"` and a hardcoded fallback recommendation: `extraction_strategies` of `["web-page-text", "web-page-html", "web-page-screenshot"]`, `execution_strategy` of `"ai"`, and `reasoning` of `"Default configuration applied"`. Check for that exact `reasoning` string before treating a response as tailored to your instructions.
</Warning>

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Config resolved successfully",
      "data": {
        "resolvedConfig": {
          "extraction_strategies": ["web-page-text"],
          "execution_strategy": "ai",
          "reasoning": "..."
        }
      }
    }
  }
  ```
</ResponseExample>
