Gradient Cloud AI API

OpenAI-compatible inference API for Gradient Cloud — model listing, chat completion, and text completion (streaming and non-streaming) served across Gradient's distributed compute network. Authenticated with an access key (HTTP Bearer); the List Models endpoint is public.

OpenAPI Specification

gradient-cloud-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Gradient Cloud AI API
  version: v1
  description: >-
    OpenAI-compatible inference API for Gradient Cloud — the enterprise inference
    service of Gradient's Open Intelligence Stack, serving open models across a
    distributed compute network (Parallax) over Gradient's peer-to-peer data
    motion engine (Lattica). The API implements OpenAI-compatible interfaces for
    model listing, chat completion, and text completion (streaming and
    non-streaming). Generated by the API Evangelist enrichment pipeline from the
    provider's published API Reference Documentation; not an official provider
    OpenAPI. Verify against the live docs before production use.
  contact:
    name: Gradient
    url: https://docs.gradient.network/enterprise-solutions/gradient-cloud/api-reference-documentation
  x-apievangelist-generated: true
  x-apievangelist-source: https://docs.gradient.network/enterprise-solutions/gradient-cloud/api-reference-documentation.md
servers:
  - url: https://apis.gradient.network/api/v1
    description: Gradient Cloud production
tags:
  - name: Models
    description: Model listing and management
  - name: Chat
    description: Chat completion
  - name: Completions
    description: Text completion
security:
  - AccessKey: []
paths:
  /ai/models:
    get:
      tags: [Models]
      operationId: listModels
      summary: List all models
      description: List of all available AI models. No authentication required.
      security: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelList'
              example:
                object: list
                data:
                  - id: qwen/qwen3-coder-480b-instruct-fp8
                    object: model
                    created: 1640995200
                    owned_by: qwen
                    permission: []
                    root: qwen/qwen3-coder-480b-instruct-fp8
                    parent: null
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /ai/chat/completions:
    post:
      tags: [Chat]
      operationId: createChatCompletion
      summary: Chat completion
      description: >-
        Create a chat completion request, supporting both streaming and
        non-streaming responses.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            example:
              model: qwen/qwen3-coder-480b-instruct-fp8
              messages:
                - role: user
                  content: Hello, how are you?
              temperature: 0.7
              max_tokens: 100
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
            text/event-stream:
              schema:
                type: string
                description: "Server-sent event stream of chat.completion.chunk objects, terminated by `data: [DONE]`."
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Billing Check Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Model Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate Limit Exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /ai/completions:
    post:
      tags: [Completions]
      operationId: createCompletion
      summary: Text completion
      description: >-
        Create a text completion request, supporting both streaming and
        non-streaming responses.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompletionRequest'
            example:
              model: qwen/qwen3-coder-480b-instruct-fp8
              prompt: Once upon a time
              temperature: 0.7
              max_tokens: 100
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Completion'
            text/event-stream:
              schema:
                type: string
                description: "Server-sent event stream, terminated by `data: [DONE]`."
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Billing Check Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Model Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate Limit Exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  securitySchemes:
    AccessKey:
      type: http
      scheme: bearer
      description: "Access Key passed as `Authorization: Bearer <access-key>`."
  schemas:
    Model:
      type: object
      properties:
        id: { type: string }
        object: { type: string }
        created: { type: integer }
        owned_by: { type: string }
        permission: { type: array, items: { type: object } }
        root: { type: string }
        parent: { type: string, nullable: true }
    ModelList:
      type: object
      properties:
        object: { type: string }
        data:
          type: array
          items: { $ref: '#/components/schemas/Model' }
    ChatMessage:
      type: object
      required: [role, content]
      properties:
        role: { type: string, enum: [system, user, assistant] }
        content: { type: string }
    ChatCompletionRequest:
      type: object
      required: [model, messages]
      properties:
        model: { type: string, description: The ID of the model to use }
        messages:
          type: array
          items: { $ref: '#/components/schemas/ChatMessage' }
        stream: { type: boolean, default: false }
        max_tokens: { type: integer }
        temperature: { type: number, default: 1, minimum: 0, maximum: 2 }
        top_p: { type: number, default: 1, minimum: 0, maximum: 1 }
        n: { type: integer, default: 1 }
        stop:
          oneOf:
            - { type: string }
            - { type: array, items: { type: string } }
        presence_penalty: { type: number, default: 0, minimum: -2, maximum: 2 }
        frequency_penalty: { type: number, default: 0, minimum: -2, maximum: 2 }
        logit_bias: { type: object }
        user: { type: string }
    ChatCompletion:
      type: object
      properties:
        id: { type: string }
        object: { type: string }
        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 }
        usage: { $ref: '#/components/schemas/Usage' }
    CompletionRequest:
      type: object
      required: [model, prompt]
      properties:
        model: { type: string }
        prompt:
          oneOf:
            - { type: string }
            - { type: array, items: { type: string } }
        suffix: { type: string }
        max_tokens: { type: integer }
        temperature: { type: number, default: 1, minimum: 0, maximum: 2 }
        top_p: { type: number, default: 1, minimum: 0, maximum: 1 }
        n: { type: integer, default: 1 }
        stream: { type: boolean, default: false }
    Completion:
      type: object
      properties:
        id: { type: string }
        object: { type: string }
        created: { type: integer }
        model: { type: string }
        choices:
          type: array
          items:
            type: object
            properties:
              text: { type: string }
              index: { type: integer }
              finish_reason: { type: string }
        usage: { $ref: '#/components/schemas/Usage' }
    Usage:
      type: object
      properties:
        prompt_tokens: { type: integer }
        completion_tokens: { type: integer }
        total_tokens: { type: integer }
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message: { type: string }
            type: { type: string }
            code: { type: string }