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

# Connect an application

> Move a tested agent into an application using the REST API or an official SDK.

Once an agent behaves as expected in the Playground, connect it from a trusted server. The API and SDK guides contain request details; this page covers the console-to-production handoff.

## Before you integrate

* Note the agent ID from the agent view.
* Create a server-side [API key](https://docs.reygrid.com/platform/api-keys.md).
* Confirm the agent's knowledge has finished indexing.
* Decide what stable user identifier your application will send.

## Send a message

```bash theme={"system"}
curl -X POST https://reygrid.com/api/v1/agents/{AgentId}/chat \
  -H "Authorization: Bearer $REYGRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"How do returns work?","userId":"customer_42"}'
```

Replace `{AgentId}` with the ID shown in the console. A stable `userId` lets ReyGrid associate messages with a persistent conversation. Prefer an internal identifier that does not expose sensitive personal information.

## Choose an integration path

> [card] [REST API](https://docs.reygrid.com/rest-api/overview.md)
>
> Use HTTP directly from your backend.

> [card] [Python SDK](https://docs.reygrid.com/integrations/python/installation.md)
>
> Use the official Python client.

> [card] [TypeScript SDK](https://docs.reygrid.com/integrations/typescript/installation.md)
>
> Use the official TypeScript client.

## After launch

Watch API Logs for failed requests, inspect Conversations for answer quality, and review Analytics and usage. See [Test and improve an agent](https://docs.reygrid.com/platform/test-improve.md) for an improvement loop and [API errors](https://docs.reygrid.com/rest-api/errors.md) for troubleshooting.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.