> For the complete documentation index, see [llms.txt](https://docs.cashramp.co/cashramp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cashramp.co/cashramp/cashramp-bot-api/overview.md).

# Overview

The Cashramp Bot API is a GraphQL API for agents — it lets you programmatically access your agent profile, balances, rates, and account settings, and manage P2P payments on behalf of your bot.

## Endpoint

| Environment    | URL                                              |
| -------------- | ------------------------------------------------ |
| **Production** | `https://api.useaccrue.com/cashramp/bot/graphql` |

## Authentication

All requests require an **agent API key** passed as a Bearer token:

```
Authorization: Bearer {api_key}
```

### Example

{% hint style="info" %}
First-party SDKs do not yet cover the Bot API. Use the raw-HTTP examples below until the Bot SDK ships.
{% endhint %}

{% tabs %}
{% tab title="Node (axios)" %}

```javascript
import axios from "axios";

const cashrampBot = axios.create({
  baseURL: "https://api.useaccrue.com/cashramp/bot/graphql",
  headers: {
    Authorization: `Bearer ${process.env.AGENT_API_KEY}`,
  },
});
```

{% endtab %}

{% tab title="Python (requests)" %}

```python
import os
import requests

CASHRAMP_BOT_URL = "https://api.useaccrue.com/cashramp/bot/graphql"

cashramp_bot = requests.Session()
cashramp_bot.headers.update({
    "Authorization": f"Bearer {os.environ['AGENT_API_KEY']}",
    "Content-Type": "application/json",
})
```

{% endtab %}

{% tab title="Ruby (net/http)" %}

```ruby
require "net/http"
require "uri"
require "json"

CASHRAMP_BOT_URL = URI("https://api.useaccrue.com/cashramp/bot/graphql")

def cashramp_bot_request(query, variables = {})
  http = Net::HTTP.new(CASHRAMP_BOT_URL.host, CASHRAMP_BOT_URL.port)
  http.use_ssl = true
  req = Net::HTTP::Post.new(CASHRAMP_BOT_URL)
  req["Authorization"] = "Bearer #{ENV['AGENT_API_KEY']}"
  req["Content-Type"] = "application/json"
  req.body = { query: query, variables: variables }.to_json
  JSON.parse(http.request(req).body)
end
```

{% endtab %}

{% tab title="Go (net/http)" %}

```go
package main

import (
  "bytes"
  "encoding/json"
  "net/http"
  "os"
)

const cashrampBotURL = "https://api.useaccrue.com/cashramp/bot/graphql"

func cashrampBotRequest(query string, variables map[string]any) (*http.Response, error) {
  body, _ := json.Marshal(map[string]any{"query": query, "variables": variables})
  req, err := http.NewRequest("POST", cashrampBotURL, bytes.NewBuffer(body))
  if err != nil {
    return nil, err
  }
  req.Header.Set("Authorization", "Bearer "+os.Getenv("AGENT_API_KEY"))
  req.Header.Set("Content-Type", "application/json")
  return http.DefaultClient.Do(req)
}
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl https://api.useaccrue.com/cashramp/bot/graphql \
  -H "Authorization: Bearer $AGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "{ agent { id } }" }'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
All requests must be over **HTTPS**. Calls without valid authentication are rejected.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.cashramp.co/cashramp/cashramp-bot-api/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
