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

# 连接网站

> 连接主机并获得只显示一次的网站密钥。



## OpenAPI

````yaml POST /v1/ai-rendering/sites
openapi: 3.1.0
info:
  title: querying.ai
  description: >-
    One API for every AI answer engine. Every task is asynchronous: submit, then
    collect the result via webhook or polling.
  version: 1.0.0
servers:
  - url: https://api.querying.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/ai-rendering/sites:
    post:
      tags:
        - AI Rendering
      summary: Connect a site
      description: >-
        Connects a host and returns its site key once. The site's CDN reads the
        site's copy list with the key. An account connects up to 20 sites, each
        host once. Connecting a site is free.
      operationId: createAiRenderingSite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiRenderingSiteRequest'
            example:
              host: www.example.com
      responses:
        '201':
          description: The site and its key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiRenderingSiteKeyResponse'
              example:
                success: true
                site:
                  id: 5b0e9f52-6a3c-4f0e-8d0b-2c7e4a1f9d33
                  host: www.example.com
                  refreshDays: 28
                  country: US
                  keyPrefix: rs_8f2c4a1b
                  pages: 0
                  createdAt: '2026-10-23T01:00:00.000Z'
                  updatedAt: '2026-10-23T01:00:00.000Z'
                key: rs_8f2c4a1b…
        '400':
          description: >-
            VALIDATION_ERROR: the body is not a JSON object or has an unknown
            field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            SITE_EXISTS: the account already connected the host. SITE_LIMIT: the
            account has 20 sites.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            VALIDATION_ERROR: host, agents, mode, refreshDays or country is not
            valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AiRenderingSiteRequest:
      type: object
      required:
        - host
      additionalProperties: false
      properties:
        host:
          type: string
          description: >-
            The public host name the site's CDN serves, such as www.example.com.
            Which AI agents get a copy is set in the site's CDN.
        refreshDays:
          type: integer
          minimum: 1
          maximum: 28
        country:
          type: string
          enum:
            - US
            - KR
    AiRenderingSiteKeyResponse:
      type: object
      required:
        - success
        - site
        - key
      properties:
        success:
          type: boolean
        site:
          $ref: '#/components/schemas/AiRenderingSite'
        key:
          type: string
          description: >-
            The site key, rs_ and 64 hex characters. It is shown only in this
            response; querying.ai stores its hash.
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    AiRenderingSite:
      type: object
      required:
        - id
        - host
        - refreshDays
        - country
        - keyPrefix
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        host:
          type: string
          description: The site's host name, lower case, without a port.
        refreshDays:
          type: integer
          minimum: 1
          maximum: 28
          description: Days between renders of a published page. Default 28.
        country:
          type: string
          enum:
            - US
            - KR
          description: Where the site's pages are rendered from. Default US.
        keyPrefix:
          type: string
          description: >-
            The first 11 characters of the site key, which reads the site's copy
            list.
        pages:
          type: integer
          description: >-
            Published pages. Absent from a site that was just updated or given a
            new key.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable, safe to branch on. See the Errors guide for the full list.
        message:
          type: string
          description: For humans. May change.
        details:
          description: >-
            Context for the error. An array of `{field, message}` on most
            `VALIDATION_ERROR`s; an object elsewhere (for example `{id}` on
            `RESOURCE_NOT_FOUND`, `retryAfterSec` on 429 and 503 codes). Omitted
            when there is nothing to add.
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
            - type: object
              additionalProperties: true
        timestamp:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as `Authorization: Bearer <key>`.'

````

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