> ## 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.

# Quickstart

> Validate your API key and send your first message to a ReyGrid agent in a few minutes.

You need a ReyGrid **API key** and the **ID of an agent**. Pick the way you want to call the API.

<Tabs>
  <Tab title="cURL" icon="terminal">
    <Steps>
      <Step title="Set your API key">
        ```bash theme={"system"}
        export REYGRID_API_KEY="your-api-key"
        ```
      </Step>

      <Step title="Check the API is up">
        `GET /ping` needs no authentication.

        ```bash theme={"system"}
        curl https://reygrid.com/api/v1/ping
        ```
      </Step>

      <Step title="Validate your key">
        ```bash theme={"system"}
        curl https://reygrid.com/api/v1/validate \
          -H "Authorization: Bearer $REYGRID_API_KEY"
        ```

        A valid key returns `"valid": true` with your `usage`.
      </Step>

      <Step title="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": "Hello!", "userId": "user_42"}'
        ```

        The reply text is at `output.reply.content`.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Python" icon="python">
    <Steps>
      <Step title="Install">
        ```bash theme={"system"}
        pip install reygrid
        ```
      </Step>

      <Step title="Run your first request">
        ```python theme={"system"}
        from reygrid import ReyGrid

        client = ReyGrid(api_key="your-api-key")

        print(client.ping().status)          # UP
        print(client.get_usage())            # Usage(total=..., quotaLimit=...)

        reply = client.chat("{AgentId}", "Hello!", user_id="user_42")
        print(reply.output.reply.content)
        ```
      </Step>
    </Steps>

    Continue with the [Python SDK guide](/integrations/python/installation).
  </Tab>

  <Tab title="TypeScript" icon="js">
    <Steps>
      <Step title="Install">
        ```bash theme={"system"}
        npm install reygrid
        ```
      </Step>

      <Step title="Run your first request">
        ```typescript theme={"system"}
        import { ReyGrid } from "reygrid";

        const client = new ReyGrid({ apiKey: "your-api-key" });

        console.log((await client.ping()).status); // UP
        console.log(await client.getUsage());      // { total, quotaLimit }

        const res = await client.chat("{AgentId}", "Hello!", { userId: "user_42" });
        console.log(res.output.reply.content);
        ```
      </Step>
    </Steps>

    Continue with the [TypeScript SDK guide](/integrations/typescript/installation).
  </Tab>
</Tabs>

<Tip>
  Passing a stable `userId` gives that user a persistent conversation, so you don't have to resend history. See [Persistent conversations](/rest-api/conversations).
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/rest-api/authentication">How API keys are sent and what 401s look like.</Card>
  <Card title="Stream replies" icon="bolt" href="/rest-api/streaming">Get tokens as they are generated.</Card>
  <Card title="API reference" icon="book" href="/api-reference/chat-with-an-agent">Every endpoint with an interactive playground.</Card>
  <Card title="Handle errors" icon="triangle-exclamation" href="/rest-api/errors">Error payloads and status codes.</Card>
</CardGroup>


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