codai Guest chat API

Anonymous free chat without an account (ADR 2026-10-28). Limits: 3 sessions/day x 10 messages per device, model `codai`, web search/fetch, documents and an ephemeral sandbox; no files, memory or history on the server. Off while `ANON_CHAT_ENABLED` is unset (503 `anon_disabled`).

GitHub OpenAPI

Operations 4

1 of 4 operations are conformant: apis.io called them with no credentials and the responses matched this contract. Checked 2026-11-12. how this works · status file

GET /v1/anon/challenge Get a guest-session challenge conformant #
POST /v1/anon/session Start a guest session #
GET /v1/anon/status Guest session limits #
POST /v1/anon/import Import a guest chat into an account #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/codai-ro:codai-ro-guest-chat-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

codai-ro-guest-chat-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Codai Ro Guest chat API
  version: '1'
  description: 'Operations tagged Guest chat across 2 of this provider''s published API definitions: codai-ro-gateway-openapi.json, codai-ro-gateway-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://ai.codai.ro
  description: Production
security:
- bearerAuth: []
tags:
- name: Guest chat
  description: 'Anonymous free chat without an account (ADR 2026-10-28). Limits: 3 sessions/day x 10 messages per device, model `codai`, web search/fetch, documents and an ephemeral sandbox; no files, memory or history on the server. Off while `ANON_CHAT_ENABLED` is unset (503 `anon_disabled`).'
paths:
  /v1/anon/challenge:
    get:
      operationId: anonChallenge
      tags:
      - Guest chat
      summary: Get a guest-session challenge
      security: []
      description: Returns a single-use nonce (5 min) and the proof-of-work difficulty for the surface. No key needed; 30 requests per minute per client IP.
      parameters:
      - name: surface
        in: query
        required: true
        description: Client surface.
        schema:
          type: string
          enum:
          - web
          - android
          - ios
          - desktop
          - vscode
          - wear
          - tv
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - nonce
                - pow_bits
                - expires_at
                properties:
                  nonce:
                    type: string
                  pow_bits:
                    type: integer
                  expires_at:
                    type: string
                    format: date-time
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          description: anon_disabled, anon_budget_exhausted or anon_unavailable (counters unreachable, fail closed).
    servers:
    - url: https://ai.codai.ro
      description: Production
  /v1/anon/session:
    post:
      operationId: anonCreateSession
      tags:
      - Guest chat
      summary: Start a guest session
      security: []
      description: 'Exchanges the nonce plus a proof (proof-of-work, Cloudflare Turnstile, Play Integrity or App Attest) for a 2-hour guest token `anon_v1.*`. Send it as `Authorization: Bearer` to `POST /v1/chat/completions`. Requires accepting the Terms and confirming the user is 18+. The 4th session of a UTC day per device or IP is refused with 429 `anon_session_limit`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - surface
              - device_id
              - nonce
              - accept_terms
              - confirm_adult
              - proof
              properties:
                surface:
                  type: string
                  enum:
                  - web
                  - android
                  - ios
                  - desktop
                  - vscode
                  - wear
                  - tv
                device_id:
                  type: string
                  format: uuid
                nonce:
                  type: string
                accept_terms:
                  type: boolean
                  enum:
                  - true
                confirm_adult:
                  type: boolean
                  enum:
                  - true
                proof:
                  type: object
                  description: Exactly one of pow, turnstile, play_integrity, app_attest.
                  properties:
                    pow:
                      type: object
                      properties:
                        counter:
                          type: string
                    turnstile:
                      type: string
                    play_integrity:
                      type: string
                    app_attest:
                      type: object
                      properties:
                        key_id:
                          type: string
                        attestation:
                          type: string
                        assertion:
                          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - token
                - session_id
                - expires_at
                - limits
                properties:
                  token:
                    type: string
                  session_id:
                    type: string
                    format: uuid
                  expires_at:
                    type: string
                    format: date-time
                  signup_url:
                    type: string
                    format: uri
                  terms_version:
                    type: string
                  limits:
                    type: object
                    properties:
                      sessions_per_day:
                        type: integer
                      sessions_left:
                        type: integer
                      messages_per_session:
                        type: integer
                      messages_left:
                        type: integer
                      soft_wall_at:
                        type: integer
                      resets_at:
                        type: string
                        format: date-time
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          description: anon_disabled, anon_budget_exhausted or anon_unavailable (counters unreachable, fail closed).
    servers:
    - url: https://ai.codai.ro
      description: Production
  /v1/anon/status:
    get:
      operationId: anonStatus
      tags:
      - Guest chat
      summary: Guest session limits
      description: Sessions and messages left today and whether the daily guest budget is still open.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  budget_open:
                    type: boolean
                  limits:
                    type: object
                    properties:
                      sessions_per_day:
                        type: integer
                      sessions_left:
                        type: integer
                      messages_per_session:
                        type: integer
                      messages_left:
                        type: integer
                      soft_wall_at:
                        type: integer
                      resets_at:
                        type: string
                        format: date-time
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          description: anon_disabled, anon_budget_exhausted or anon_unavailable (counters unreachable, fail closed).
    servers:
    - url: https://ai.codai.ro
      description: Production
  /v1/anon/import:
    post:
      operationId: anonImport
      tags:
      - Guest chat
      summary: Import a guest chat into an account
      description: 'Called with the NEW account API key right after sign-up: stores the guest history (kept on the device until now) as a cloud session of the account. Each guest token imports once (409 `anon_already_imported`); tokens up to 7 days old are accepted.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - anon_token
              - messages
              properties:
                anon_token:
                  type: string
                title:
                  type: string
                  maxLength: 200
                messages:
                  type: array
                  items:
                    type: object
                    required:
                    - role
                    - content
                    properties:
                      role:
                        type: string
                        enum:
                        - user
                        - assistant
                      content:
                        type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - session_id
                properties:
                  session_id:
                    type: string
                    format: uuid
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: anon_already_imported
        '503':
          description: anon_disabled, anon_budget_exhausted or anon_unavailable (counters unreachable, fail closed).
    servers:
    - url: https://ai.codai.ro
      description: Production
components:
  responses:
    Unauthorized:
      description: Missing, malformed, revoked or paused API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The key is valid but not allowed to perform this action (model allow-list, role, ownership).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Per-key RPM/RPH, token-per-minute budget, spend cap (`rate_limit_exceeded`) or task quota (`quota_exceeded`). Read `Retry-After`.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            minimum: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Malformed body or query; `details` holds the flattened field errors.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - message
          - type
          - code
          properties:
            message:
              type: string
              description: Human-readable, provider names redacted.
            type:
              type: string
              enum:
              - invalid_request_error
              - subscription_required
              - rate_limit_error
              - upstream_error
              - server_error
            code:
              type: string
              enum:
              - bad_request
              - invalid_api_key
              - subscription_inactive
              - forbidden
              - not_found
              - payload_too_large
              - rate_limit_exceeded
              - quota_exceeded
              - upstream_error
              - internal_error
              - not_a_member
              - lease_held
              - seq_conflict
              - host_offline
              - host_timeout
              - rules_refused
              - search_unavailable
              - task_not_confirmable
              - slug_taken
              - project_has_environments
              - already_has_env
              - not_enrollable
              - not_byo
              - invalid_transition
              - already_member
              - vm_per_dev_single_member
              - last_owner
              - insufficient_balance
              - key_scope_forbidden
              - assets_unavailable
              - asset_not_found
              - too_many_renders
              - renders_unavailable
              - timeline_too_long
              - not_a_timeline
              - invalid_cursor
              - templates_unavailable
              - url_blocked
              - invalid_tokens
              - unsupported_media
              - kind_mismatch
              - node_not_found
              - invalid_pick
              - duplicate_key
              - unknown_var
              - invalid_var_value
              - unsupported_kind
              - too_long
              - stale
              - not_supported_for_kind
              - unsupported_format
              - too_large
              - not_implemented
              - version_conflict
              - settings_unavailable
              - ai_label_required
              - sandbox_concurrency_limit
              - sandbox_busy
              - sandbox_daily_limit
              - invalid_ttl
              - workspace_too_large
              - sandbox_paused_limit
              - sandbox_capacity
            details:
              description: Present on `bad_request` (flattened Zod field errors), `invalid_tokens` (`issues`) and `rules_refused` (`tool`, `rule_id`, `decision`). Other codes never forward details over HTTP.
              type: object
              additionalProperties: true
      examples:
      - error:
          message: Invalid or missing API key.
          type: invalid_request_error
          code: invalid_api_key
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: codai_…
      description: A codai API key (`codai_` prefix). Ephemeral tokens from `POST /v1/tokens` are accepted only by the media surfaces matching their scope (`/v1/realtime`, `/v1/audio/*`, `/v1/embeddings`).
x-refined-from:
- codai-ro-gateway-openapi.json
- codai-ro-gateway-openapi.yml