Logicc
Logicc
  • Docs
  • Changelog
  • Support portal
    • API Documentation
Docs / Integrations & API

API Documentation

1. Introduction

This documentation describes the technical specification and usage of the Logicc AI API.

The API provides a central and unified access point (endpoint) to a variety of leading language models (LLMs). All requests are handled through a single OpenAI-compatible v1/chat/completions endpoint.

This approach significantly reduces implementation complexity because developers can use models from different providers, including OpenAI, Google, Anthropic, and Mistral, through a consistent and standardized API structure without having to develop a separate integration for each model.

2. Authentication

An API key is required to use the Logicc AI API.

Obtaining the API key:
A personal API key is issued by customer support to customers with an active subscription.

Using the API key:
The API key must be sent as a Bearer token in the Authorization header with every request.

Header example:Authorization: Bearer YOUR_LOGICC_API_KEY

Replace YOUR_LOGICC_API_KEY with your provided key.


3. Endpoint: Chat completion

The primary endpoint is used to generate text responses and is fully compatible with the OpenAI Chat Completions API standard.

POST https://api.logicc.io/v1/chat/completions

Headers:

  • Content-Type: application/json
  • Authorization: Bearer YOUR_LOGICC_API_KEY

4. Request body

The body of the POST request must be a JSON object containing the following parameters:

Field Type Required Description
model string Yes The ID of the model to use for the request. A complete list of available model identifiers is in section 5.
messages array Yes A list of message objects that represent the conversation history. Each object must contain a role (system, user, assistant) and content (text content).
temperature number No Controls the randomness of the output. Values near 2.0 lead to more creative results, values near 0.0 to more deterministic results. Default: 1.0.
max_tokens integer No The maximum number of tokens to generate in the answer.
stream boolean No If true, answer tokens are sent as Server-Sent Events (SSE) as soon as they are available, enabling a streaming response. Default: false.

Example for messages:

"messages": [
  {
    "role": "system",
    "content": "You are a helpful assistant for technical questions."
  },
  {
    "role": "user",
    "content": "Explain the difference between `REST` and `GraphQL`."
  }
]

4a. Endpoint: Models (/models)

This endpoint provides an overview of all models enabled for the respective account. The response follows the OpenAI schema for GET /v1/models.

Method: GET

Path: /models

Headers:

  • Authorization: Bearer YOUR_LOGICC_API_KEY

Description:

  • Returns only the models enabled for the respective customer.
  • Suitable for filling UI dropdowns or validating model IDs server-side.

Example response:

{
  "data": [
    {
      "id": "gpt-5-nano",
      "object": "model",
      "created": 1677610602,
      "owned_by": "openai"
    },
    {
      "id": "o3-mini",
      "object": "model",
      "created": 1677610602,
      "owned_by": "openai"
    },
    ...
  ],
  "object": "list"
}

cURL

curl -X GET \
  -H "Authorization: Bearer YOUR_LOGICC_API_KEY" \
  https://api.logicc.io/v1/models

5. Available models / price list

The following model identifiers can be specified in the model parameter:
Additional models on request.

Model name API identifier
GPT 5 nano gpt-5-nano
GPT o3-mini o3-mini
GPT 4.1 Mini gpt-4.1-mini
GPT 4.1 Nano gpt-4.1-nano
GPT 4o gpt-4o
GPT 4o-mini gpt-4o-mini
Gemini 2.5 Pro gemini-2.5-pro
Gemini 2.5 Flash gemini-2.5-flash
Gemini 2.5 Flash Lite gemini-2.5-flash-lite

Model Input price per 1M tokens Output price per 1M tokens
OpenAI GPT-5 $1.59 $12.65
OpenAI GPT-5 Mini $0.322 $2.53
OpenAI GPT-5 Nano $0.07 $0.51
OpenAI GPT-4o $3.16 $12.65
OpenAI GPT-4o Mini $0.19 $0.76
OpenAI GPT-4.1 Mini $0.51 $2.02
OpenAI GPT-4.1 Nano $0.13 $0.51
OpenAI GPT-o3 Mini $1.39 $5.57
Anthropic Claude 4.6 Opus $6.33 $31.63
Anthropic Claude 4.5 Haiku $1.26 $6.33
Gemini 2.5 Pro (up to 200k tokens) $1.4375 $11.5
Gemini 2.5 Pro (over 200k tokens) $2.875 $17.25
Gemini 2.5 Flash $0.34 $2.88
Gemini 2.5 Flash Lite $0.115 $0.46
Gemini Embedding 001 $0.17 N/A

6. Response object

A successful request returns a JSON object with the following structure:

Field Type Description
id string A unique ID for the chat completion request.
object string The object type, here chat.completion.
created integer The Unix timestamp for creation of the answer.
model string The model used for the request.
choices array A list of completion options. For this endpoint, usually only one item is returned.
choices[].message object The message object with the model's answer. Contains role ('assistant') and content.
choices[].finish_reason string The reason token generation ended, such as stop for a natural end or length when max_tokens is reached.
usage object An object with token usage statistics (prompt_tokens, completion_tokens, total_tokens).

7. Code examples

cURL

curl <https://api.logicc.io/v1/chat/completions> \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_LOGICC_API_KEY" \\
  -d '{
    "model": "gemini-2.5-pro",
    "messages": [
      {
        "role": "user",
        "content": "What is Earth's escape velocity in km/h?"
      }
    ]
  }'

Python (with requests)

import requests
import json

api_key = "YOUR_LOGICC_API_KEY"
headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {api_key}"
}

data = {
    "model": "claude-3-7-sonnet",
    "messages": [
        {"role": "user", "content": "Write a Python function that finds prime numbers."}
    ]
}

try:
    response = requests.post("<https://api.logicc.io/v1/chat/completions>", headers=headers, data=json.dumps(data))
    response.raise_for_status() # Raises an HTTPError for bad responses (4xx or 5xx)

    result = response.json()
    print(result['choices'][0]['message']['content'])
except requests.exceptions.RequestException as e:
    print(f"An error occurred: {e}")
    if hasattr(e, 'response') and e.response is not None:
        print(f"Response from server: {e.response.text}")

Node.js (with axios)

const axios = require('axios');

const apiKey = 'YOUR_LOGICC_API_KEY';
const url = '<https://api.logicc.io/v1/chat/completions>';

const data = {
  model: 'gpt-4o',
  messages: [
    { role: 'user', content: 'How does a neural network work? Explain it for a beginner.' }
  ]
};

const headers = {
  'Content-Type': 'application/json',
  'Authorization': `Bearer ${apiKey}`
};

axios.post(url, data, { headers })
  .then(response => {
    console.log(response.data.choices[0].message.content);
  })
  .catch(error => {
    console.error('Error during API request:', error.response ? error.response.data : error.message);
  });
PrevAgreements
NextContact support
Was this helpful?