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

# Get LLM response

> Fetch a live AI-generated response for a topic on a specific platform (cached 6h).



## OpenAPI

````yaml https://api.surnex.io/openapi.json post /v1/projects/{project_id}/geo/llm-response
openapi: 3.1.0
info:
  title: Surnex API
  description: |-
    Surnex SEO Platform API — api.surnex.io

    Provides the complete backend for the Surnex SEO dashboard including:
    - Multi-tenant organization management
    - Project tracking (domains)
    - Keyword rank tracking (Phase 1+)
    - Backlink analysis (Phase 3+)
    - Site auditing (Phase 4+)
    - Stripe billing integration
    - MCP endpoint for AI agents at /mcp
  version: 0.1.0
servers: []
security: []
paths:
  /v1/projects/{project_id}/geo/llm-response:
    post:
      tags:
        - GEO / AI Visibility
      summary: Get LLM response
      description: >-
        Fetch a live AI-generated response for a topic on a specific platform
        (cached 6h).
      operationId: get_llm_response_v1_projects__project_id__geo_llm_response_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LlmResponseRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_GeoLlmResponseResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    LlmResponseRequest:
      properties:
        topic_id:
          type: string
          format: uuid
          title: Topic Id
          description: UUID of the GeoTopic to fetch an LLM response for.
        platform:
          type: string
          title: Platform
          description: >-
            AI platform to query. One of: 'google_ai', 'chatgpt', 'perplexity',
            'claude'.
      type: object
      required:
        - topic_id
        - platform
      title: LlmResponseRequest
      description: |-
        Request body for fetching a live LLM response for a specific topic.

        Triggers a DataForSEO AI Optimization API call to retrieve the current
        AI-generated response for the topic's keyword on the specified platform.
    APIResponse_GeoLlmResponseResponse_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - $ref: '#/components/schemas/GeoLlmResponseResponse'
            - type: 'null'
      type: object
      title: APIResponse[GeoLlmResponseResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GeoLlmResponseResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        topic_id:
          type: string
          format: uuid
          title: Topic Id
        keyword:
          type: string
          title: Keyword
        platform:
          type: string
          title: Platform
        response_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Response Text
          description: Raw text response returned by the AI platform.
        cited_sources:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Cited Sources
          description: Sources cited in the AI response.
        domain_cited:
          type: boolean
          title: Domain Cited
          description: Whether the project's domain appeared in the cited sources.
        fetched_at:
          type: string
          title: Fetched At
          description: ISO 8601 datetime string when this response was fetched.
        citation_order:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Citation Order
          description: Order in which sources were cited.
        response_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Response Format
          description: Format metadata of the LLM response.
        model_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Version
          description: LLM model version that generated the response.
        content_classification:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Classification
          description: Content classification of the response.
      type: object
      required:
        - id
        - topic_id
        - keyword
        - platform
        - domain_cited
        - fetched_at
      title: GeoLlmResponseResponse
      description: Serialised representation of a GeoLlmResponse ORM record.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````