API Reference

Chat Completions (OpenAI-compatible)

POST /openai/chat/completions

Generate text using OpenAI-compatible chat models like GPT-4, Claude-3, and Gemini Pro.

ParameterTypeReqDescriptionExample
modelstringrequiredModel ID (e.g., gpt-4-turbo, claude-3-sonnet, gemini-pro)gpt-4-turbo
messagesarrayrequiredList of role/content objects[{role:'user',content:'Hi'}]
temperaturenumberoptionalDeterminism vs creativity (0–2)0.7
top_pnumberoptionalNucleus sampling (0–1)1
max_tokensnumberoptionalMax tokens to generate1024
streambooleanoptionalStream response in chunksfalse
stoparrayoptionalStop sequences['\n', 'END']
{
  "model": "gpt-4-turbo",
  "messages": [{"role": "user", "content": "Hello"}],
  "temperature": 0.7,
  "max_tokens": 1024,
  "stream": false
}

Images (DALL·E 3)

POST /openai/images/generations

Generate high-quality images from text descriptions using DALL-E 3.

ParameterTypeReqDescriptionExample
modelstringrequiredModel IDdall-e-3
promptstringrequiredText description of the image (max 1000 chars)A cozy cabin…
sizeenumoptionalImage size1024x1024 | 1792x1024 | 1024x1792
qualityenumoptionalQuality tierstandard | hd
styleenumoptionalStyle preferencenatural | vivid
nnumberoptionalNumber of images (max 1 for dall-e-3)1
{
  "model": "dall-e-3",
  "prompt": "A cozy cabin in the woods at sunset, photorealistic style",
  "size": "1024x1024",
  "quality": "standard",
  "style": "natural",
  "n": 1
}

Image Editing (Google Nano Banana)

POST /google/nano-banana

Edit images using Google's Nano Banana model with text prompts.

ParameterTypeReqDescriptionExample
promptstringrequiredText description of desired changesMake the sheets blue
imagestringrequiredBase64 encoded input imagedata:image/jpeg;base64,...
{
  "prompt": "Make the sheets in the style of the logo. Make the scene natural.",
  "image": "base64_encoded_image_data"
}

Video (Runway Gen-3)

POST /runway/generate

Generate videos from text prompts or images using Runway's Gen-3 model.

ParameterTypeReqDescriptionExample
modelstringrequiredModel IDrunway-gen3
modeenumrequiredGeneration modetext_to_video | image_to_video
promptstringrequiredVideo description or styleAerial shot over ocean
image_urlstringconditionalSource image for image_to_video modehttps://…/input.png
durationnumberoptionalVideo length in seconds4 | 8 | 16
resolutionenumoptionalOutput resolution768x768 | 1280x768 | 768x1280
seednumberoptionalDeterministic seed for reproducibility42
{
  "model": "runway-gen3",
  "mode": "text_to_video",
  "prompt": "Aerial shot over ocean at golden hour, cinematic",
  "duration": 8,
  "resolution": "1280x768",
  "seed": 42
}

Text-to-Speech (ElevenLabs)

POST /elevenlabs/tts

Convert text to natural-sounding speech using ElevenLabs voices.

ParameterTypeReqDescriptionExample
textstringrequiredText to synthesize (max 2500 chars)Hello from Core API
voice_idstringrequiredVoice identifierrachel | adam | sam | etc.
model_idstringoptionalTTS model versioneleven_monolingual_v1
voice_settingsobjectoptionalVoice stability and similarity{stability: 0.75}
{
  "text": "Hello from Core API, this is a test of speech synthesis.",
  "voice_id": "rachel",
  "model_id": "eleven_monolingual_v1",
  "voice_settings": {
    "stability": 0.75,
    "similarity_boost": 0.75
  }
}

Text-to-Speech (Azure Speech)

POST /azure/speech

Convert text to speech using Microsoft Azure's neural voices with SSML support.

ParameterTypeReqDescriptionExample
textstringrequiredText to synthesizeWelcome to Core API
voicestringrequiredAzure neural voice IDen-US-JennyNeural
stylestringoptionalSpeaking stylegeneral | cheerful | sad
ratenumberoptionalSpeech rate (-50 to 50)0
pitchnumberoptionalVoice pitch (-50 to 50)0
{
  "text": "Welcome to Core API, your unified AI platform",
  "voice": "en-US-JennyNeural",
  "style": "cheerful",
  "rate": 0,
  "pitch": 5
}

Rate Limiting & Best Practices

Rate Limits

  • Free tier: 10 requests/minute per endpoint
  • Pro tier: 100 requests/minute per endpoint
  • Enterprise: Custom limits available

HTTP Status Codes

  • 200 - Success
  • 400 - Bad Request (invalid parameters)
  • 401 - Unauthorized (invalid API key)
  • 429 - Rate limit exceeded
  • 500 - Server error (retry with backoff)

Best Practices

  • Implement exponential backoff for 429 and 5xx errors
  • Cache responses when possible to reduce API calls
  • Use streaming for real-time applications
  • Monitor your usage in the dashboard
  • Keep API keys secure and rotate regularly

Mori API is an AI model aggregation platform that gives developers a single, unified API to access 50+ AI models across text, image, audio, and video — with transparent pricing, real‑time analytics, and enterprise‑grade reliability.

Copyright © 2024 CoreAPI Inc
All rights reserved