# /parameters-extraction

## Extract parameters from a prompt.

<mark style="color:green;">`POST`</mark> `https://api.brianknows.org/api/v0/agent/parameters-extraction`

Allows you to send a prompt to Brian and return all the extracted parameters from the prompt.

You can implement your own custom logic and decide how to use the extracted parameters in you app. For example, you could take the swap parameters and build an integration on a chain that is not currently supported by Brian.

#### Headers

| Name                                              | Type             | Description        |
| ------------------------------------------------- | ---------------- | ------------------ |
| x-brian-api-key<mark style="color:red;">\*</mark> | String           | Brian API key.     |
| Content-Type<mark style="color:red;">\*</mark>    | application/json | Body content type. |

#### Request Body

| Name                                     | Type   | Description        |
| ---------------------------------------- | ------ | ------------------ |
| prompt<mark style="color:red;">\*</mark> | String | User input prompt. |

#### Requesting information

{% code overflow="wrap" %}

```bash
curl -XPOST "https://api.brianknows.org/api/v0/agent/parameters-extraction" -H "Content-Type: application/json" -H "x-brian-api-key: API_KEY" -d '{"prompt": "swap 1 eth to usdc on arbitrum"}'
```

{% endcode %}

{% tabs %}
{% tab title="200: OK OK." %}
{% code title="Response" overflow="wrap" fullWidth="true" %}

```json
{
  "result": {
    "prompt": "swap 1 eth to usdc on arbitrum",
    "completion": [
      {
        "action": "swap",
        "token1": "eth",
        "chain": "usdc",
        "amount": "1".
        ... // other parameters
      }
    ]
  }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.brianknows.org/brian-api/apis/parameters-extraction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
