Cleanlab Codex API

The Codex API from Cleanlab — 1 operation(s) for codex.

Operations 1

POST /api/v1/codex/projects/{project_id}/validate Validate an AI response (guardrail + remediation) #

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/cleanlab-codex-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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

cleanlab-codex-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cleanlab Codex API
  description: Specification of the Cleanlab data-and-AI trust platform APIs. Covers the Trustworthy Language Model (TLM) OpenAI-compatible Chat Completions endpoint, the Codex / Cleanlab AI Platform project validation (guardrail and remediation) endpoint, and the Cleanlab Studio deployed-model REST inference endpoint. All endpoints are HTTPS REST and authenticate with a Cleanlab API key (or project access key) supplied as a Bearer token.
  termsOfService: https://cleanlab.ai/legal/terms-of-service/
  contact:
    name: Cleanlab Support
    email: support@cleanlab.ai
  version: '1.0'
servers:
- url: https://api.cleanlab.ai
  description: Cleanlab platform API
security:
- bearerAuth: []
tags:
- name: Codex
paths:
  /api/v1/codex/projects/{project_id}/validate:
    post:
      operationId: validateResponse
      tags:
      - Codex
      summary: Validate an AI response (guardrail + remediation)
      description: Validates an AI application's response against a Codex project. Returns whether the response should be guardrailed, eval scores across configured criteria, whether it was escalated to a subject-matter expert, and an expert answer to remediate the response when a semantically similar verified answer exists in the project. Authenticate with the project access key as a Bearer token.
      parameters:
      - name: project_id
        in: path
        required: true
        description: The Cleanlab Codex project identifier.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateResponse'
        '401':
          description: Invalid or missing access key.
        '404':
          description: Project not found.
        '422':
          description: Invalid request parameters.
components:
  schemas:
    ValidateResponse:
      type: object
      properties:
        should_guardrail:
          type: boolean
          description: Whether the response should be suppressed or replaced.
        escalated_to_sme:
          type: boolean
          description: Whether the query was escalated to a subject-matter expert.
        eval_scores:
          type: object
          description: Numeric scores across configured evaluation criteria.
          additionalProperties:
            type: object
            additionalProperties: true
        expert_answer:
          type:
          - string
          - 'null'
          description: A verified expert answer to remediate the response, if available.
        log_id:
          type: string
          description: Identifier of the logged query record.
    ChatMessage:
      type: object
      required:
      - role
      - content
      properties:
        role:
          type: string
          enum:
          - system
          - user
          - assistant
          - tool
        content:
          type: string
    ValidateRequest:
      type: object
      required:
      - response
      properties:
        query:
          type: string
          description: The core user question.
        context:
          type: string
          description: Retrieved context supplied to the LLM (for RAG).
        response:
          type: string
          description: The AI-generated response being validated.
        messages:
          type: array
          description: Full prompt / conversation history in Chat Completions format.
          items:
            $ref: '#/components/schemas/ChatMessage'
        rewritten_query:
          type:
          - string
          - 'null'
        eval_scores:
          type: object
          description: Pre-computed eval scores to pass through instead of recomputing.
          additionalProperties:
            type: number
        metadata:
          type: object
          additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Cleanlab API key (TLM / Studio) or Codex project access key, supplied as a Bearer token in the Authorization header.