/text-with-image.php
Chat completions with optional image understanding.
POST
JSON
Vision optional
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| prompt | string | yes | The user message you want the model to respond to. |
| image_url | string | no |
Public HTTP(S) URL of an image to analyze.
Use an empty string ("") when no image is needed.
|
| apikey | string | yes | Your Celestialization API key. |
Example request (vision)
POST https://api.celestialization.com/api/text-with-image.php
Content-Type: application/json
{
"prompt": "what is in this image?",
"image_url": "https://sample-files.com/downloads/images/jpg/web_optimized_1200x800_97kb.jpg",
"apikey": "YOUR_API_KEY"
}
Example response
{
"id": "chatcmpl-CaMxvxfJzYndQw8DLn8fLMdkHwuCB",
"object": "chat.completion",
"created": 1762784123,
"model": "gpt-4o-2024-08-06",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The image shows a person using a laptop. ...",
"refusal": null,
"annotations": []
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 1117,
"completion_tokens": 48,
"total_tokens": 1165
},
"service_tier": "default"
}
The main natural language answer is in
choices[0].message.content.