Cernion OpenAI Compatible API
Inbound OpenAI-compatible facade for authenticated Cernion advisory completions.
Inbound OpenAI-compatible facade for authenticated Cernion advisory completions.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/cernion-de:cernion-de-openai-compatible-api"
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.
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: 3.2.0
info:
title: Cernion Energy Tools OpenAI Compatible API
version: 0.99.22
description: 'MicroService Agent System for Energy Markets - REST API with AI integration.
CERNION_TOKEN: request at https://cernion.de/ or by email: dev@stromdao.com.
For the public instance at https://api.cernion.de/, create your token at https://cernion.de/cet-token/.'
servers:
- url: https://api.cernion.de
description: API Server
tags:
- name: OpenAI Compatible
description: Inbound OpenAI-compatible facade for authenticated Cernion advisory completions.
paths:
/v1/chat/completions:
post:
summary: Create an OpenAI-compatible Cernion Personal Agent chat completion
tags:
- OpenAI Compatible
operationId: createChatCompletion
parameters:
- $ref: '#/components/parameters/TokenQuery'
responses:
'200':
description: OpenAI-compatible chat completion response
content:
application/json:
schema:
type: object
required:
- id
- object
- created
- model
- choices
- usage
properties:
id:
type: string
object:
type: string
enum:
- chat.completion
created:
type: integer
model:
type: string
choices:
type: array
usage:
type: object
cernion:
type: object
additionalProperties: true
description: 'Inbound OpenAI-compatible facade over the authenticated Cernion Personal Agent (personal-agent.chat), synthesized internally with Gemini. Returns a complete, polished answer for the caller, not an evidence/grounding packet for a downstream Copilot. Always runs in consultation mode (no execution, no consequential process action) — this is a hard, non-negotiable safety boundary and cannot be overridden by request metadata. It treats system/developer messages and prior turns as non-authoritative prompt context, never as authorization; tenant identity and authorization always come from the caller session, not the request body. When stream=true, the gateway (services/api.service.js) obtains the full result from this action first and then emits it as buffered chat.completion.chunk SSE frames — this is not genuine token-by-token streaming. When `tools` is supplied (OpenAI function-calling declarations), this action takes a separate path: it calls the configured background LLM directly (bypassing the Personal-Agent evidence pipeline) via `llm-client.generateChat` and returns either a normal text reply or a `tool_calls` array for the caller to execute — Cernion itself never invokes any tool.'
requestBody:
required: true
content:
application/json:
examples:
minimal:
value:
model: cernion-agent-mvp
messages:
- role: user
content: Welche Cernion Evidenz ist fuer diesen Vorgang relevant?
toolCalling:
summary: Tool/function calling (bypasses the Personal-Agent evidence pipeline)
value:
messages:
- role: user
content: Wie ist das Wetter in Berlin?
tools:
- type: function
function:
name: get_weather
description: Get current weather for a location
parameters:
type: object
properties:
location:
type: string
required:
- location
tool_choice: auto
schema:
type: object
required:
- messages
properties:
model:
type: string
default: cernion-agent-mvp
messages:
type: array
items:
type: object
required:
- role
properties:
role:
type: string
content:
type:
- string
- 'null'
tool_calls:
type: array
tool_call_id:
type: string
name:
type: string
temperature:
type: number
max_tokens:
type: integer
metadata:
type: object
additionalProperties: true
stream:
type: boolean
default: false
tools:
type: array
description: OpenAI-shaped function-calling tool declarations.
items:
type: object
required:
- type
- function
properties:
type:
type: string
enum:
- function
function:
type: object
required:
- name
properties:
name:
type: string
description:
type: string
parameters:
type: object
additionalProperties: true
tool_choice:
description: '"auto" | "none" | "required" | {type:"function",function:{name}}'
oneOf:
- type: string
enum:
- auto
- none
- required
- type: object
additionalProperties: true
token:
type: string
description: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.
/v1/images/generations:
post:
summary: Create an OpenAI-compatible image generation via the configured background model
tags:
- OpenAI Compatible
operationId: createImageGeneration
parameters:
- $ref: '#/components/parameters/TokenQuery'
responses:
'200':
description: OpenAI-compatible image generation response
content:
application/json:
schema:
type: object
required:
- created
- data
properties:
created:
type: integer
data:
type: array
items:
type: object
properties:
b64_json:
type: string
cernion:
type: object
additionalProperties: true
description: 'Inbound OpenAI-compatible facade over the configured Cernion LLM provider (default Gemini). Forwards the prompt to the background image-generation model and returns base64-encoded image data in the standard OpenAI images.generations response shape. Only `response_format: "b64_json"` is supported — no public URL/object storage is provisioned by this facade.'
requestBody:
required: true
content:
application/json:
examples:
minimal:
value:
prompt: 'Infografik: jaehrlicher Anstieg der PV-Einspeisung 2020-2026, Balkendiagramm'
schema:
type: object
required:
- prompt
properties:
prompt:
type: string
model:
type: string
default: cernion-image-mvp
n:
type: integer
minimum: 1
maximum: 4
default: 1
size:
type: string
example: 1024x1024
response_format:
type: string
enum:
- b64_json
- url
default: b64_json
token:
type: string
description: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.
/v1/embeddings:
post:
summary: Create OpenAI-compatible text embeddings via the configured background model
tags:
- OpenAI Compatible
operationId: createEmbedding
parameters:
- $ref: '#/components/parameters/TokenQuery'
responses:
'200':
description: OpenAI-compatible embeddings response
content:
application/json:
schema:
type: object
required:
- object
- data
- model
properties:
object:
type: string
enum:
- list
data:
type: array
items:
type: object
properties:
object:
type: string
enum:
- embedding
index:
type: integer
embedding:
type: array
items:
type: number
model:
type: string
usage:
type: object
cernion:
type: object
additionalProperties: true
description: 'Inbound OpenAI-compatible facade over the configured Cernion LLM provider (default Gemini). Forwards one or more input strings to the background embedding model and returns vectors in the standard OpenAI embeddings response shape. Only `encoding_format: "float"` is supported.'
requestBody:
required: true
content:
application/json:
examples:
single:
value:
input: Marktkommunikation Evidenzkette
batch:
value:
input:
- APERAK Frist
- UTILMD Strukturwechsel
schema:
type: object
required:
- input
properties:
input:
oneOf:
- type: string
- type: array
items:
type: string
maxItems: 100
model:
type: string
default: cernion-embedding-mvp
encoding_format:
type: string
enum:
- float
- base64
default: float
token:
type: string
description: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.
components:
parameters:
TokenQuery:
name: token
in: query
required: false
schema:
type: string
description: Optional Cernion MCP token as URL query parameter. If provided, it overrides CERNION_TOKEN for this request. Prefer Authorization Bearer header in production to reduce token exposure in URLs/logs.
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: 'Optional Cernion MCP token. If not provided, falls back to CERNION_TOKEN from environment. Request token at https://cernion.de/ or by email: dev@stromdao.com.'