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

# Generate agent from natural language

> Generate an AI agent configuration from a natural language description. Uses the same LLM-powered generation as the in-product agent builder. This is a public endpoint that does not require authentication. Rate limited to 5 requests per day per IP address. The response includes a `claim_token` that can be redeemed via `POST /agents/claim` after signing up to persist the agent.



## OpenAPI

````yaml post /agents/generate
openapi: 3.0.3
info:
  version: 0.1.1
  title: Datagrid API
  description: Datagrid API
servers:
  - url: https://api.datagrid.com/v1
security:
  - BearerAuth: []
paths:
  /agents/generate:
    post:
      tags:
        - Agents
      summary: Generate agent from natural language
      description: >-
        Generate an AI agent configuration from a natural language description.
        Uses the same LLM-powered generation as the in-product agent builder.
        This is a public endpoint that does not require authentication. Rate
        limited to 5 requests per day per IP address. The response includes a
        `claim_token` that can be redeemed via `POST /agents/claim` after
        signing up to persist the agent.
      operationId: GenerateAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
              properties:
                prompt:
                  type: string
                  maxLength: 2000
                  description: >-
                    Natural language description of the agent you want. e.g. "I
                    want an agent that helps my sales team answer product
                    questions and draft follow-up emails."
      responses:
        '200':
          description: Generated agent template with a claim token
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - title
                  - description
                  - emoji
                  - prompt_examples
                  - config
                  - claim_token
                properties:
                  id:
                    type: string
                  title:
                    type: string
                  description:
                    type: string
                  emoji:
                    type: string
                  category:
                    type: string
                  prompt_examples:
                    type: array
                    items:
                      type: string
                  connectors:
                    type: array
                    items:
                      type: object
                  config:
                    type: object
                    properties:
                      prompt:
                        type: string
                        nullable: true
                        description: System instructions for the agent
                      custom_prompt:
                        type: string
                        nullable: true
                        description: Custom instructions (tone, style)
                      tools:
                        type: array
                        items:
                          type: object
                          properties:
                            tool:
                              type: string
                  claim_token:
                    type: string
                    format: uuid
                    description: >-
                      One-time token to create this agent in your account after
                      signing up. Pass to `POST /agents/claim`. Expires after 7
                      days.
          headers:
            X-RateLimit-Limit:
              description: The number of allowed requests in the current window
              schema:
                type: integer
                example: 5
            X-RateLimit-Remaining:
              description: The number of remaining requests in the current window
              schema:
                type: integer
                example: 2
            X-RateLimit-Reset:
              description: >-
                The time at which the current rate limit window resets (Unix
                timestamp)
              schema:
                type: integer
                example: 1609459200
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
      security: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Datagrid from 'datagrid-ai';

            const client = new Datagrid();

            const response = await client.agents.generate({ prompt: 'prompt' });

            console.log(response.id);
        - lang: Python
          source: |-
            from datagrid_ai import Datagrid

            client = Datagrid()
            response = client.agents.generate(
                prompt="prompt",
            )
            print(response.id)
components:
  schemas:
    RateLimitError:
      type: object
      description: >-
        Returned when the rate limit is exceeded. Rate limits are enforced per
        teamspace, endpoint path, and HTTP method over a 60-second sliding
        window. Each endpoint may have its own limit — check the
        X-RateLimit-Limit response header for the effective value.
      required:
        - error
        - message
        - retryable
        - status_code
      properties:
        status_code:
          type: integer
          description: The HTTP status code (429).
        statusCode:
          type: integer
          deprecated: true
          description: Deprecated. Use status_code instead.
        error:
          type: string
          enum:
            - rate_limit_exceeded
          description: The error code identifying this as a rate limit error.
        message:
          type: string
          description: A human-readable error message.
        mitigation:
          type: string
          description: Suggested action to resolve the error.
        retryable:
          type: boolean
          description: Whether the request can be retried after a delay.
        details:
          type: object
          properties:
            reason:
              type: string
              description: A detailed explanation of why the rate limit was exceeded.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````