CentML Clusters API

Platform (control-plane) API for listing regional clusters and GPU capacity available to place deployments on, used when selecting hardware and region for dedicated endpoints.

OpenAPI Specification

centml-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: CentML API
  description: >-
    Specification of the CentML API surface. CentML exposes two related but
    distinct HTTP APIs: (1) an OpenAI-compatible serverless inference API for
    chat completions, text completions, and model listing served at
    https://api.centml.com/openai/v1, authenticated with a Bearer serverless
    token; and (2) a platform (control-plane) API for managing dedicated
    inference / compute / job deployments and clusters, also Bearer-authenticated.
    Both are modeled here. Endpoints reflect CentML's published documentation
    (docs.centml.ai) and the official platform_api_python_client.
  termsOfService: https://centml.ai/terms-of-service/
  contact:
    name: CentML Support
    url: https://docs.centml.ai/resources/requesting_support
  version: '1.0'
servers:
  - url: https://api.centml.com/openai/v1
    description: OpenAI-compatible serverless inference base URL.
  - url: https://api.centml.com
    description: CentML platform (control-plane) base URL for deployments and clusters.
security:
  - bearerAuth: []
paths:
  /chat/completions:
    post:
      operationId: createChatCompletion
      tags:
        - Chat
      summary: Creates a model response for the given chat conversation.
      description: >-
        OpenAI-compatible chat completions endpoint. Pass a `model` ID from the
        serverless catalog and a `messages` array. Set `stream: true` to receive
        the response as Server-Sent Events. Served at
        https://api.centml.com/openai/v1/chat/completions.
      servers:
        - url: https://api.centml.com/openai/v1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChatCompletionRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateChatCompletionResponse'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ChatCompletionChunk'
  /completions:
    post:
      operationId: createCompletion
      tags:
        - Completions
      summary: Creates a completion for the provided prompt.
      description: >-
        OpenAI-compatible text completions endpoint. Served at
        https://api.centml.com/openai/v1/completions.
      servers:
        - url: https://api.centml.com/openai/v1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompletionRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCompletionResponse'
  /models:
    get:
      operationId: listModels
      tags:
        - Models
      summary: Lists the models available on CentML serverless endpoints.
      description: >-
        Returns the set of model IDs available to the authenticated account on
        the OpenAI-compatible serverless API. Served at
        https://api.centml.com/openai/v1/models.
      servers:
        - url: https://api.centml.com/openai/v1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListModelsResponse'
  /models/{model}:
    get:
      operationId: retrieveModel
      tags:
        - Models
      summary: Retrieves a model instance.
      description: >-
        Returns metadata for a single model by ID. Served at
        https://api.centml.com/openai/v1/models/{model}.
      servers:
        - url: https://api.centml.com/openai/v1
      parameters:
        - name: model
          in: path
          required: true
          description: The ID of the model to retrieve.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Model'
  /deployments:
    get:
      operationId: listDeployments
      tags:
        - Deployments
      summary: Lists all deployments for the account.
      description: >-
        Platform control-plane endpoint. Returns all deployments (inference,
        compute, and job) for the authenticated account. Served at
        https://api.centml.com/deployments.
      servers:
        - url: https://api.centml.com
      parameters:
        - name: type
          in: query
          required: false
          description: Optional deployment type filter (e.g. inference, compute, job).
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentList'
  /deployments/inference:
    post:
      operationId: createInferenceDeployment
      tags:
        - Deployments
      summary: Creates a dedicated inference deployment.
      description: >-
        Platform control-plane endpoint. Creates a dedicated, autoscaling
        inference deployment that serves a model as an HTTPS endpoint on a
        selected cluster and hardware instance. Served at
        https://api.centml.com/deployments/inference.
      servers:
        - url: https://api.centml.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInferenceDeploymentRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
    put:
      operationId: updateInferenceDeployment
      tags:
        - Deployments
      summary: Updates an existing inference deployment.
      servers:
        - url: https://api.centml.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInferenceDeploymentRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
  /deployments/inference/{deployment_id}:
    get:
      operationId: getInferenceDeployment
      tags:
        - Deployments
      summary: Retrieves an inference deployment by ID.
      servers:
        - url: https://api.centml.com
      parameters:
        - name: deployment_id
          in: path
          required: true
          description: The ID of the deployment to retrieve.
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
  /deployments/compute:
    post:
      operationId: createComputeDeployment
      tags:
        - Deployments
      summary: Creates a compute deployment.
      description: >-
        Platform control-plane endpoint to create a compute deployment. Served
        at https://api.centml.com/deployments/compute.
      servers:
        - url: https://api.centml.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateComputeDeploymentRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
  /deployments/status/{deployment_id}:
    get:
      operationId: getDeploymentStatus
      tags:
        - Deployments
      summary: Gets the status of a deployment.
      servers:
        - url: https://api.centml.com
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentStatus'
    put:
      operationId: updateDeploymentStatus
      tags:
        - Deployments
      summary: Updates the status of a deployment (e.g. pause or delete).
      servers:
        - url: https://api.centml.com
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeploymentStatus'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentStatus'
  /deployments/logs/{deployment_id}:
    get:
      operationId: getDeploymentLogs
      tags:
        - Deployments
      summary: Returns logs for a deployment.
      servers:
        - url: https://api.centml.com
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentLogs'
  /clusters:
    get:
      operationId: getClusters
      tags:
        - Clusters
      summary: Lists the regional clusters available to the account.
      description: >-
        Platform control-plane endpoint. Returns the managed regional clusters a
        deployment can be placed on. Served at https://api.centml.com/clusters.
      servers:
        - url: https://api.centml.com
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClusterList'
  /capacity:
    get:
      operationId: listCapacity
      tags:
        - Clusters
      summary: Lists available GPU capacity and hardware instances.
      description: >-
        Platform control-plane endpoint. Returns the GPU hardware instance types
        and available capacity for placing deployments. Served at
        https://api.centml.com/capacity.
      servers:
        - url: https://api.centml.com
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapacityList'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: 'CentML API key'
      description: >-
        Set the `Authorization: Bearer <CENTML_API_KEY>` header. Serverless
        inference uses a serverless token; the platform API uses an account
        access token. Both are issued from the CentML platform.
  schemas:
    CreateChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: ID of a serverless model, e.g. meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8.
        messages:
          type: array
          description: A list of messages comprising the conversation so far.
          items:
            $ref: '#/components/schemas/ChatMessage'
        max_tokens:
          type: integer
          nullable: true
          description: The maximum number of tokens to generate in the completion.
        temperature:
          type: number
          nullable: true
          default: 1
          description: Sampling temperature between 0 and 2.
        top_p:
          type: number
          nullable: true
          default: 1
          description: Nucleus sampling probability mass.
        top_k:
          type: integer
          nullable: true
          description: Limits sampling to the top K tokens.
        n:
          type: integer
          nullable: true
          default: 1
          description: How many chat completion choices to generate.
        stream:
          type: boolean
          nullable: true
          default: false
          description: If true, partial deltas are sent as Server-Sent Events.
        stop:
          type: array
          nullable: true
          items:
            type: string
          description: Up to 4 sequences where the API will stop generating.
        frequency_penalty:
          type: number
          nullable: true
          default: 0
          description: Penalizes new tokens based on existing frequency.
        presence_penalty:
          type: number
          nullable: true
          default: 0
          description: Penalizes new tokens based on whether they appear so far.
        tools:
          type: array
          description: A list of tools (functions) the model may call.
          items:
            type: object
        response_format:
          type: object
          description: An object specifying the format the model must output (e.g. JSON).
    ChatMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
          description: The role of the message author.
        content:
          type: string
          nullable: true
          description: The contents of the message.
        name:
          type: string
          description: An optional name for the participant.
    CreateChatCompletionResponse:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - chat.completion
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                $ref: '#/components/schemas/ChatMessage'
              finish_reason:
                type: string
                nullable: true
                enum:
                  - stop
                  - length
                  - tool_calls
        usage:
          $ref: '#/components/schemas/Usage'
    ChatCompletionChunk:
      type: object
      description: A streamed chunk of a chat completion (SSE), object chat.completion.chunk.
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - chat.completion.chunk
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              delta:
                $ref: '#/components/schemas/ChatMessage'
              finish_reason:
                type: string
                nullable: true
    CreateCompletionRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
        prompt:
          type: string
          description: The prompt to generate completions for.
        max_tokens:
          type: integer
          nullable: true
        temperature:
          type: number
          nullable: true
          default: 1
        top_p:
          type: number
          nullable: true
          default: 1
        n:
          type: integer
          nullable: true
          default: 1
        stream:
          type: boolean
          nullable: true
          default: false
        stop:
          type: array
          nullable: true
          items:
            type: string
    CreateCompletionResponse:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - text_completion
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              text:
                type: string
              finish_reason:
                type: string
                nullable: true
        usage:
          $ref: '#/components/schemas/Usage'
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
    ListModelsResponse:
      type: object
      required:
        - object
        - data
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/Model'
    Model:
      type: object
      required:
        - id
        - object
      properties:
        id:
          type: string
          description: The model identifier.
        object:
          type: string
          enum:
            - model
        created:
          type: integer
        owned_by:
          type: string
    DeploymentList:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Deployment'
    Deployment:
      type: object
      properties:
        id:
          type: integer
          description: The unique deployment ID.
        name:
          type: string
          description: Human-readable deployment name.
        type:
          type: string
          description: Deployment type (inference, compute, or job).
        status:
          type: string
          description: Current deployment status (e.g. running, paused, deleted).
        cluster_id:
          type: integer
          description: The cluster the deployment is placed on.
        endpoint_url:
          type: string
          description: The HTTPS endpoint URL once the deployment is ready.
    CreateInferenceDeploymentRequest:
      type: object
      required:
        - name
        - cluster_id
        - hardware_instance_id
      properties:
        name:
          type: string
          description: A name for the inference deployment.
        cluster_id:
          type: integer
          description: ID of the cluster to deploy to (from GET /clusters).
        hardware_instance_id:
          type: integer
          description: ID of the GPU hardware instance (from GET /capacity).
        model:
          type: string
          description: The model or image to serve.
        min_replicas:
          type: integer
          description: Minimum number of replicas for autoscaling.
        max_replicas:
          type: integer
          description: Maximum number of replicas for autoscaling.
    CreateComputeDeploymentRequest:
      type: object
      required:
        - name
        - cluster_id
        - hardware_instance_id
      properties:
        name:
          type: string
        cluster_id:
          type: integer
        hardware_instance_id:
          type: integer
    DeploymentStatus:
      type: object
      properties:
        id:
          type: integer
        status:
          type: string
          description: The deployment status to read or set (e.g. running, paused, deleted).
    DeploymentLogs:
      type: object
      properties:
        logs:
          type: string
          description: Log output for the deployment.
    ClusterList:
      type: object
      properties:
        clusters:
          type: array
          items:
            $ref: '#/components/schemas/Cluster'
    Cluster:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        region:
          type: string
    CapacityList:
      type: object
      properties:
        hardware_instances:
          type: array
          items:
            $ref: '#/components/schemas/HardwareInstance'
    HardwareInstance:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          description: GPU instance type (e.g. A100, H100, L4).
        gpu_count:
          type: integer
        cost_per_hour:
          type: number
          description: Per-GPU-hour cost for the instance.