gpt-4o-all File Analysis
Brief:
gpt-4o-allis a multimodal model (based on gpt-4o) that supports image/file analysis and web access. This page shows how to provide file/image URLs for analysis.
Overview
- Method:
POST - Path:
/v1/chat/completions - Content-Type:
application/json
Authentication
Common header-based authentication formats are supported:
- OpenAI-style:
Authorization: Bearer sk-xxx - Other:
x-api-key: sk-xxx(depends on backend implementation)
Features
- Image analysis: include an image URL or base64 (data:) in a message
contentto trigger image understanding. - File analysis: include a file URL together with a question in the message
content(or embed the file as base64). Example format:<file_url> <space> <question>.
Request Example
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | yes | Model name, e.g. gpt-4o-all |
| messages | array<object> | yes | Chat messages array. Each item can be `{ role: 'user' |
| temperature | number | no | Sampling temperature, 0-2 |
| top_p | number | no | Nucleus sampling parameter |
| stream | boolean | no | Whether to return streaming responses |
| max_tokens | number | no | Maximum tokens to generate |
Example (file analysis):
json
{
"model": "gpt-4o-all",
"messages": [
{ "role": "user", "content": "https://www.bt.cn/data/api-doc.pdf What is the API to add a domain?" }
],
"max_tokens": 1688,
"temperature": 0.5,
"stream": false
}curl example
bash
curl -X POST "https://api.gpt.ge/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxx" \
-d '{"model":"gpt-4o-all","messages":[{"role":"user","content":"https://www.bt.cn/data/api-doc.pdf What is the API to add a domain?"}],"max_tokens":1688,"temperature":0.5}'JavaScript (fetch) example
javascript
fetch('https://api.gpt.ge/v1/chat/completions', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer sk-xxxx' },
body: JSON.stringify({ model: 'gpt-4o-all', messages: [{ role: 'user', content: 'https://www.bt.cn/data/api-doc.pdf What is the API to add a domain?' }], max_tokens: 1688, temperature: 0.5 })
}).then(r => r.json()).then(console.log)Python (requests) example
python
import requests
payload = {
'model': 'gpt-4o-all',
'messages': [{'role':'user','content':'https://www.bt.cn/data/api-doc.pdf What is the API to add a domain?'}],
'max_tokens': 1688,
'temperature': 0.5
}
resp = requests.post('https://api.gpt.ge/v1/chat/completions', headers={'Content-Type':'application/json','Authorization':'Bearer sk-xxxx'}, json=payload)
print(resp.json())Response Example (200)
json
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "To add a domain, the document refers to the following:\n\n1. **API path**: /domains/add\n2. **Method**: POST\n3. **Parameters**: domain, user_id, type, etc.\n\nSee the document for sample requests and responses.",
"role": "assistant"
}
}
],
"created": 1724997805,
"id": "chatcmpl-EqJ6TxTZRW1sUgfFTbATPumIFWzCi",
"model": "gpt-4o",
"object": "chat.completion",
"usage": { "completion_tokens": 292, "prompt_tokens": 13, "total_tokens": 305 },
"system_fingerprint": "fp_example"
}