C Cira Mind

API

Cira Mind API

OpenAI-kompatibel. Nutze ein beliebiges OpenAI SDK, setze die Base URL und deinen Cira Mind API-Schlüssel. Es gelten dasselbe Tagesbudget und dieselben Warteschlangen-Regeln wie im Chat.

Base URL

https://mind.cierra.cloud/v1

Modell

imara

Imara, unser erstes eigenes Modell. Weitere Modelle folgen.

Grenzen

64k Kontext, bis zu 8.192 Ausgabe-Tokens

Endpunkte

GET/v1/modelsVerfügbare Modelle auflisten
POST/v1/chat/completionsChat Completion, mit oder ohne Streaming

curl

curl https://mind.cierra.cloud/v1/chat/completions \
  -H "Authorization: Bearer $CIRA_MIND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imara",
    "messages": [{"role": "user", "content": "Hallo Imara!"}],
    "stream": true
  }'

Python (openai)

from openai import OpenAI

client = OpenAI(base_url="https://mind.cierra.cloud/v1", api_key="cm_...")
response = client.chat.completions.create(
    model="imara",
    messages=[{"role": "user", "content": "Hallo Imara!"}],
)
print(response.choices[0].message.content)

Gut zu wissen

OpenAPI

Spezifikation anzeigen
openapi: 3.1.0
info:
  title: Cira Mind API
  version: 1.0.0
  description: |
    OpenAI compatible API of Cira Mind, the AI platform by Cierra. Models: imara (Imara, our first own model). More models will follow.
    Authenticate with a personal API key (created in the settings) as Bearer token.
    The same daily budget (free plan) and queue rules (paid before free) as in the chat apply.
servers:
  - url: https://mind.cierra.ai/v1
security:
  - bearerAuth: []
paths:
  /models:
    get:
      summary: List available models
      operationId: listModels
      responses:
        '200':
          description: Model list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelList'
        '401':
          $ref: '#/components/responses/Error'
  /chat/completions:
    post:
      summary: Create a chat completion
      operationId: createChatCompletion
      description: |
        With `stream: true` the response is `text/event-stream` with `chat.completion.chunk`
        objects, terminated by `data: [DONE]`. While waiting in the queue, SSE comments
        (`: queue position N`) are sent. Errors during a stream arrive as `data: {"error": {...}}`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
      responses:
        '200':
          description: Completion (JSON) or stream (SSE)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
            text/event-stream:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '429':
          description: Daily budget of the free plan used up (code quota_exhausted)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Model is starting (code model_starting) or queue is full (code queue_timeout). Retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal Cira Mind API key (starts with cm_)
  responses:
    Error:
      description: Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    ModelList:
      type: object
      properties:
        object:
          type: string
          const: list
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: imara
              object:
                type: string
                const: model
              created:
                type: integer
              owned_by:
                type: string
                example: cierra
              context_window:
                type: integer
                example: 65536
              max_output_tokens:
                type: integer
                example: 8192
    Message:
      type: object
      required: [role, content]
      properties:
        role:
          type: string
          enum: [system, developer, user, assistant, tool]
        content:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
    ChatCompletionRequest:
      type: object
      required: [messages]
      properties:
        model:
          type: string
          default: imara
          enum: [imara]
          description: Public model id. Unknown ids return 404 model_not_found.
        messages:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Message'
        stream:
          type: boolean
          default: false
        stream_options:
          type: object
          properties:
            include_usage:
              type: boolean
        max_tokens:
          type: integer
          minimum: 1
          maximum: 8192
          description: Capped at 8192. On the free plan also capped at the remaining daily budget.
        temperature:
          type: number
          minimum: 0
          maximum: 2
        top_p:
          type: number
        stop:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        presence_penalty:
          type: number
        frequency_penalty:
          type: number
        seed:
          type: integer
    ChatCompletion:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          const: chat.completion
        created:
          type: integer
        model:
          type: string
          example: imara
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                $ref: '#/components/schemas/Message'
              finish_reason:
                type: string
        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