API Documentation
Complete reference for the RanGPT API. Base URL: https://rangpt.rancoded.com
1. Chat API
Generate text responses using various AI models.
POST
/api/chat
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | The user's input message. |
| model | string | No | The AI model to use. Options: gpt-4o (default), gpt-3.5. |
| systemPrompt | string | No | Custom system instruction to guide the AI's behavior. |
Example Request
{
"message": "Explain quantum computing",
"model": "gpt-4o",
"systemPrompt": "You are a physics teacher"
}
Example Response
{
"text": "Quantum computing is like...",
"model": "gpt-4o",
"citations": []
}
2. Image Generation API
Generate images from text descriptions.
POST
/api/image
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Description of the image to generate. |
| model | string | No | Image model. Default: deepimg. |
| style | string | No | Image style. Options: default, anime, cyberpunk. |
| size | string | No | Aspect ratio. Default: 1:1. |
Example Request
{
"prompt": "A futuristic city with flying cars",
"model": "deepimg",
"style": "cyberpunk"
}
Example Response
{
"success": true,
"model": "deepimg",
"imageUrl": "https://..."
}
3. IshChat API
Advanced chat models including Grok and GPT-OSS.
POST
/api/ischat
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | The user's input message. |
| model | string | No | Model to use. Options: grok-3-mini (default), grok-4-fast-reasoning, gpt-oss-120b. |
Example Request
{
"message": "What is the meaning of life?",
"model": "grok-3-mini"
}
Example Response
{
"text": "The meaning of life is...",
"model": "grok-3-mini"
}
4. Anime Generation API
Generate high-quality anime and cyberpunk style images.
POST
/api/anime
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Description of the image. |
| style | string | No | Style to apply. Options: anime (default), cyberpunk. |
Example Request
{
"prompt": "A magical girl in a forest",
"style": "anime"
}
Example Response
{
"images": ["https://..."],
"model": "anime"
}