# Configuration

## Using your API Key with the CLI

You can set the API Key value in your configuration by using the `bindplane profile` command.e.g.

```shell
bindplane profile set default --api-key 4689832f-1725-4eeb-8f9d-3e78cb0155ec
```

This sets your "default" profile to use the API key you just received. You may also need to set your `remote-url` to the correct endpoint, for app.bindplane.com users:

```shell
bindplane profile set default --remote-url https://app.bindplane.com
```

Make sure you are using the `default` profile

```shell
bindplane profile use default
```

Now verify you can retrieve resources, say Source Types

```shell
bindplane get source-types
```

To set named profiles run

```shell
bindplane profile set "onprem" --api-key "xxxx-xxxx-xxxx-xxxx-xxxxxx"
```

To use custom remote URLs run

```shell
bindplane profile set "onprem" \
  --remote-url "http://192.168.1.10:3001" \
  --api-key "xxxx-xxxx-xxxx-xxxx-xxxxxx"
```

Configure a `profile` with a user and password

```shell
bindplane profile set "example" \
 --remote-url "http://192.168.1.10:3001" \
 --username "user" \
 --password "pass"

bindplane profile use "example"
```

## Using your API Key with the REST API

You can use your API with the REST API by setting the `X-Bindplane-Api-Key` header. An example using `curl` with Bindplane Cloud:

{% code overflow="wrap" %}

```shell
curl -X GET -H 'X-Bindplane-Api-Key: 4689832f-1725-4eeb-8f9d-3e78cb0155ec' https://app.bindplane.com/v1/source-types
```

{% endcode %}


---

# 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.bindplane.com/cli-and-api/configuration.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.
