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.
https://app.oceanicco.nl/api/v1/For On-Premise installations:
https://your-domain.com/api/v1/
Authentication
All API requests require authentication using an API key passed as a Bearer token in the Authorization header.
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.
Include it in every request
Add the header: Authorization: Bearer sk_live_ocean_YOUR_KEY
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"}'
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
๐ฌ Smart Chat
Send a message to one of Oceanic's specialized AI agents and receive a response.
Send a chat message. Maintains conversation history per session_id.
Request Body
| Parameter | Type | Description |
|---|---|---|
| message* | string | The message to send |
| agent* | string | Agent to use: general, legal, marketing, developer, analyst, copywriter, telecom |
| session_id* | string | Unique session identifier โ use a consistent ID to maintain conversation history |
| web_searchoptional | boolean | Enable real-time web search (default: false) |
| modeloptional | string | AI 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.
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"]
Query your uploaded documents using natural language.
| Parameter | Type | Description |
|---|---|---|
| query* | string | Natural language question |
| doc_idsoptional | array | Limit 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"])
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
Translate text, correct grammar, or perform OCR on images.
| Parameter | Type | Description |
|---|---|---|
| text* | string | Input text to process |
| source_langoptional | string | Source language code (e.g. en, nl, fa). Default: auto-detect |
| target_langoptional | string | Target language code. Default: en |
| modeoptional | string | translate (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.
| Parameter | Type | Description |
|---|---|---|
| query* | string | Research topic or question |
| depthoptional | string | standard (20cr), deep (35cr), comprehensive (50cr) |
| languageoptional | string | Report 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
Run an autonomous AI agent that can search the web, analyze data, and write reports.
| Parameter | Type | Description |
|---|---|---|
| task* | string | Task description for the agent |
| toolsoptional | array | Tools 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
Process an Excel or CSV file row by row using a custom AI prompt. Ideal for mass translation, content generation, or data analysis.
| Parameter | Type | Description |
|---|---|---|
| file* | file | Excel (.xlsx) or CSV file |
| input_column* | string | Column name to read from |
| prompt_template* | string | Prompt with {text} placeholder |
| output_columnoptional | string | Output 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
Create a new API key. The full key is shown only once โ store it securely.
| Parameter | Type | Description |
|---|---|---|
| name* | string | Friendly name for the key (e.g. "Production CRM") |
| scopesoptional | array | Permissions: chat, rag, translate, research, agent, bulk. Default: all |
List all API keys for your account (prefixes only โ full keys are never shown after creation).
Revoke an API key immediately. All requests using this key will be rejected.
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 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
CREDIT_EXHAUSTED โ Monthly credits used upBUDGET_EXHAUSTED โ Enterprise EUR budget reachedBoth return HTTP 402 with a
detail field explaining the reason.
Rate Limits
| Limit | Value | Reset |
|---|---|---|
| Requests per minute | 30 req/min per API key | Rolling 60 seconds |
| Daily request limit | Set by your plan | Midnight UTC |
| Monthly credits | Starter: 2,000 ยท Professional: 6,000 | 1st of each month |
| Max API keys | 10 active keys per account | โ |
| File upload size | 50 MB per file | โ |
SDKs & Examples
Oceanic uses standard REST with JSON โ no SDK required. Use any HTTP client.
requests or httpxJavaScript: native
fetch or axiosPHP:
GuzzleHttpAny 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