Set up Grok Bot with Benji Pays
This guide covers Grok Bot. You need a Benji Pays application programming interface (API) key to add the Model Context Protocol (MCP) server.
MCP server URL
https://developer.benjipays.com/mcpSend your Benji Pays API key in the x-api-key header.
Before you start
- Create an application programming interface (API) key with the scopes you need in the Benji Pays app under API Access (a read-only key is enough for questions).
- Copy it somewhere safe. You will paste it into your client’s config, not into a chat.
Keep your API key safe
Create a key with only the scopes you need. If you just want to ask accounts receivable (AR) questions, create a read-only key. You can create as many keys as you like, each with its own scopes. A company admin creates the key. You cannot edit an existing key (create a new one and delete the old). Keys expire after 1, 3, 6 or 12 months. Put the key in your AI tool’s config or an environment variable, never in a chat message. Delete it in the Benji Pays app at any time to cut off access.
Grok Bot
- Open Connect apps from the sidebar in the Grok Bot desktop app.
- At the bottom of Connect apps, choose Add a custom connector.
- Enter a name, set the type to Remote HTTPS, and enter the server URL
https://developer.benjipays.com/mcp. - Add an HTTP header named
x-api-keywith your Benji Pays API key. - Choose Add plugin to save the connector.
- In chat, type
@and the connector name to attach it, then ask a question such as “List all available Benji Pays API endpoints.”
Grok Bot can also add a Model Context Protocol (MCP) server that is not in the catalog by entering the server URL. The Benji Pays server needs the x-api-key header, so use Add a custom connector as described above. See the Grok Bot apps and connectors docs.
Grok API
- Get a Grok API key from console.x.ai.
- Add Benji Pays to the
toolsarray of a Responses API request:
curl https://api.x.ai/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{
"model": "YOUR_GROK_MODEL",
"input": "Which invoices are past due?",
"tools": [
{
"type": "mcp",
"server_url": "https://developer.benjipays.com/mcp",
"server_label": "benjipays",
"headers": { "x-api-key": "YOUR_BENJI_PAYS_API_KEY" }
}
]
}'- To limit what the Grok API can call, add
"allowed_tools", for example["list-endpoints", "search-endpoints", "execute-request"]. The Grok API does not support an approval step for Model Context Protocol (MCP) tool calls.
Using the Grok Build desktop app or the Grok Build TUI? See the Grok Build setup guide.
Test the connection
- “List all available Benji Pays API endpoints”
- “Search the Benji Pays API for anything related to invoices”
- “Get me a list of all my customers”
Troubleshooting
| Problem | Fix |
|---|---|
| 401 Unauthorized | The key is missing, mistyped or deleted, or API access is not active for your organization. Check the x-api-key header and the key in API Access. |
| 403 Forbidden | The key does not have the scope for that action. Create a key that includes it. |
| Requests slow down or return 429 | You hit the API rate limit. See Rate limits. |
Claude, Grok Build, Grok Bot, ChatGPT, Codex, Gemini and Antigravity are trademarks of their respective owners. Benji Pays is not affiliated with or endorsed by them.