Oceanic AI โ€” API Reference

Integrate enterprise-grade AI into your applications. Chat, RAG, translation, research, and more โ€” all via a simple REST API.

Overview

The Oceanic API gives your application access to all 9 AI modules running on your Oceanic instance. All requests use standard HTTP with JSON bodies and Bearer token authentication.

Base URL All API requests go to: https://app.oceanicco.nl/api/v1/
For On-Premise installations: https://your-domain.com/api/v1/
โœ… What you can do with the API Chat with AI ยท Upload & query documents ยท Translate text ยท Run deep research ยท Execute AI agents ยท Batch process spreadsheet data ยท Manage API keys ยท Check credit balance

Authentication

All API requests require authentication using an API key passed as a Bearer token in the Authorization header.

1

Generate an API Key

Go to Settings โ†’ API Keys in your Oceanic dashboard and click Generate. Copy the key immediately โ€” it is shown only once.

2

Include it in every request

Add the header: Authorization: Bearer sk_live_ocean_YOUR_KEY

3

Keep it secret

Never expose your key in frontend code or public repositories. Revoke and regenerate if compromised.

# Add to every request
curl -X POST https://app.oceanicco.nl/api/v1/chat \
  -H "Authorization: Bearer sk_live_ocean_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello!", "agent": "general", "session_id": "my-session"}'
โš ๏ธ API Key Format All Oceanic API keys start with sk_live_ocean_. If your key does not start with this prefix, it is invalid.

Quick Start

Get a response from Oceanic AI in under 60 seconds.

import requests

API_KEY  = "sk_live_ocean_YOUR_KEY"
BASE_URL = "https://app.oceanicco.nl/api/v1"

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

# Send a chat message
response = requests.post(
    f"{BASE_URL}/chat",
    headers=headers,
    json={
        "message": "Summarize the key points of GDPR",
        "agent": "general",
        "session_id": "my-app-session-001",
        "web_search": False
    }
)

data = response.json()
print(data["response"])

Credits & Rate Limits

Each API request consumes credits from your monthly allocation. Check your balance anytime via GET /usage.

Credit costs per feature

๐Ÿ’ฌ Chat message2 credits
๐ŸŒ Translate1 credit
๐Ÿ“„ RAG query2 credits
๐Ÿ”ฌ Research (standard)20 credits
๐Ÿ”ฌ Research (deep)35 credits
๐Ÿ”ฌ Research (full)50 credits
๐Ÿค– AI Agent run15 credits
๐Ÿ“Š Bulk (per 100 rows)5 credits
๐ŸŽค Voice (per minute)8 credits
๐Ÿ“ OCR / file extract2 credits
Rate Limits 30 requests/minute per API key ยท Daily limits set by your plan ยท Credits reset on the 1st of each month

๐Ÿ’ฌ Smart Chat

Send a message to one of Oceanic's specialized AI agents and receive a response.

POST /api/v1/chat 2 credits

Send a chat message. Maintains conversation history per session_id.

Request Body

ParameterTypeDescription
message*stringThe message to send
agent*stringAgent to use: general, legal, marketing, developer, analyst, copywriter, telecom
session_id*stringUnique session identifier โ€” use a consistent ID to maintain conversation history
web_searchoptionalbooleanEnable real-time web search (default: false)
modeloptionalstringAI model override: claude, gpt4o, gemini

Response

{
  "response": "GDPR (General Data Protection Regulation) is...",
  "tokens": 847,
  "session_id": "my-app-session-001",
  "credits_used": 2
}

Example

response = requests.post(f"{BASE_URL}/chat", headers=headers, json={
    "message": "What are the GDPR data retention rules?",
    "agent": "legal",
    "session_id": "contract-review-001"
})
print(response.json()["response"])

๐Ÿ“„ Documents (RAG)

Upload documents and query them using AI. The platform automatically indexes and stores vector embeddings.

POST /api/v1/rag/upload

Upload a document for indexing. Supports PDF, Word, Excel, TXT, CSV.

# Python โ€” multipart upload
with open("contract.pdf", "rb") as f:
    response = requests.post(
        f"{BASE_URL}/rag/upload",
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"file": ("contract.pdf", f, "application/pdf")}
    )
doc_id = response.json()["doc_id"]
POST /api/v1/rag/query 2 credits

Query your uploaded documents using natural language.

ParameterTypeDescription
query*stringNatural language question
doc_idsoptionalarrayLimit search to specific document IDs. Omit to search all.
response = requests.post(f"{BASE_URL}/rag/query", headers=headers, json={
    "query": "What are the payment terms in the contract?",
    "doc_ids": [doc_id]  # optional
})
print(response.json()["answer"])
GET /api/v1/rag/docs

List all uploaded documents for the current user.

docs = requests.get(f"{BASE_URL}/rag/docs", headers=headers).json()
for doc in docs["documents"]:
    print(doc["filename"], doc["doc_id"])

๐ŸŒ Translate Studio

POST /api/v1/studio/process 1 credit

Translate text, correct grammar, or perform OCR on images.

ParameterTypeDescription
text*stringInput text to process
source_langoptionalstringSource language code (e.g. en, nl, fa). Default: auto-detect
target_langoptionalstringTarget language code. Default: en
modeoptionalstringtranslate (default), grammar, formal, informal
response = requests.post(f"{BASE_URL}/studio/process", headers=headers, json={
    "text": "Hallo, hoe gaat het met jou?",
    "source_lang": "nl",
    "target_lang": "en",
    "mode": "translate"
})
print(response.json()["result"])
# โ†’ "Hello, how are you?"

๐Ÿ”ฌ Deep Research

Start an automated research job. The AI searches the web, reads sources, and writes a comprehensive report. Research jobs run asynchronously.

POST /api/v1/research/start 20โ€“50 credits
ParameterTypeDescription
query*stringResearch topic or question
depthoptionalstringstandard (20cr), deep (35cr), comprehensive (50cr)
languageoptionalstringReport language: en, nl (default: en)
# Start research job
job = requests.post(f"{BASE_URL}/research/start", headers=headers, json={
    "query": "AI regulation in the European Union 2025",
    "depth": "deep"
}).json()
job_id = job["job_id"]

# Poll for completion
import time
while True:
    status = requests.get(f"{BASE_URL}/research/status/{job_id}", headers=headers).json()
    if status["status"] == "completed":
        print(status["report"])
        break
    time.sleep(3)

๐Ÿค– AI Agent Runner

POST /api/v1/agent/run 15 credits

Run an autonomous AI agent that can search the web, analyze data, and write reports.

ParameterTypeDescription
task*stringTask description for the agent
toolsoptionalarrayTools to enable: web_search, calculator, code_runner
result = requests.post(f"{BASE_URL}/agent/run", headers=headers, json={
    "task": "Research the top 5 competitors of Salesforce and compare their pricing",
    "tools": ["web_search"]
}).json()
print(result["output"])

๐Ÿ“Š Bulk Processing

POST /api/v1/bulk/submit 5 credits / 100 rows

Process an Excel or CSV file row by row using a custom AI prompt. Ideal for mass translation, content generation, or data analysis.

ParameterTypeDescription
file*fileExcel (.xlsx) or CSV file
input_column*stringColumn name to read from
prompt_template*stringPrompt with {text} placeholder
output_columnoptionalstringOutput column name (default: AI_Result)
with open("leads.xlsx", "rb") as f:
    job = requests.post(
        f"{BASE_URL}/bulk/submit",
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"file": f},
        data={
            "input_column": "company_description",
            "prompt_template": "Classify this company: {text}. Reply with: B2B, B2C, or Both",
            "output_column": "classification"
        }
    ).json()

job_id = job["job_id"]
# Download result: GET /bulk/download/{job_id}

๐Ÿ”‘ API Key Management

POST /api/v1/apikeys

Create a new API key. The full key is shown only once โ€” store it securely.

ParameterTypeDescription
name*stringFriendly name for the key (e.g. "Production CRM")
scopesoptionalarrayPermissions: chat, rag, translate, research, agent, bulk. Default: all
GET /api/v1/apikeys

List all API keys for your account (prefixes only โ€” full keys are never shown after creation).

DELETE /api/v1/apikeys/{key_id}

Revoke an API key immediately. All requests using this key will be rejected.

GET /api/v1/apikeys/verify

Test your API key and see its permissions.

curl https://app.oceanicco.nl/api/v1/apikeys/verify \
  -H "Authorization: Bearer sk_live_ocean_YOUR_KEY"

# Response:
{
  "valid": true,
  "username": "your-username",
  "plan": "professional",
  "scopes": ["chat", "rag", "translate"],
  "auth_method": "api_key"
}

๐Ÿ“ˆ Usage

GET /api/v1/usage

Get current credit balance, plan info, and usage statistics.

usage = requests.get(f"{BASE_URL}/usage", headers=headers).json()
print(f"Credits remaining: {usage['credits_remaining']}")
print(f"Plan: {usage['plan']}")

# Response:
{
  "username": "your-username",
  "plan": "professional",
  "credits_remaining": 4820,
  "credits_monthly": 6000,
  "trial_days_left": null
}

Error Codes

400Bad Request โ€” Missing or invalid parameters. Check the request body.
401Unauthorized โ€” Missing, invalid, or revoked API key.
402Payment Required โ€” Credits exhausted or trial expired. Top up via the dashboard.
403Forbidden โ€” Your API key does not have the required scope for this endpoint.
404Not Found โ€” The requested resource does not exist.
422Unprocessable Entity โ€” Request validation failed. Check field types and requirements.
429Too Many Requests โ€” Rate limit exceeded (30 req/min). Wait and retry.
500Server Error โ€” Unexpected error. Contact support if persistent.
Credit-specific errors (402) CREDIT_EXHAUSTED โ€” Monthly credits used up
BUDGET_EXHAUSTED โ€” Enterprise EUR budget reached
Both return HTTP 402 with a detail field explaining the reason.

Rate Limits

LimitValueReset
Requests per minute30 req/min per API keyRolling 60 seconds
Daily request limitSet by your planMidnight UTC
Monthly creditsStarter: 2,000 ยท Professional: 6,0001st of each month
Max API keys10 active keys per accountโ€”
File upload size50 MB per fileโ€”

SDKs & Examples

Oceanic uses standard REST with JSON โ€” no SDK required. Use any HTTP client.

Recommended libraries Python: requests or httpx
JavaScript: native fetch or axios
PHP: GuzzleHttp
Any language with HTTP support works.

Complete Python example

import requests

class OceanicClient:
    def __init__(self, api_key, base_url="https://app.oceanicco.nl/api/v1"):
        self.headers = {
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json"
        }
        self.base = base_url

    def chat(self, message, agent="general", session_id="default"):
        r = requests.post(f"{self.base}/chat", headers=self.headers, json={
            "message": message, "agent": agent, "session_id": session_id
        })
        r.raise_for_status()
        return r.json()["response"]

    def translate(self, text, target="en"):
        r = requests.post(f"{self.base}/studio/process", headers=self.headers, json={
            "text": text, "target_lang": target
        })
        r.raise_for_status()
        return r.json()["result"]

    def credits(self):
        return requests.get(f"{self.base}/usage", headers=self.headers).json()["credits_remaining"]

# Usage
client = OceanicClient("sk_live_ocean_YOUR_KEY")
print(client.chat("Explain quantum computing in simple terms"))
print(client.translate("Hallo wereld", target="en"))
print(f"Credits left: {client.credits()}")

Need help with your integration?

Contact our team for enterprise onboarding support.

info@oceanicco.nl