Skip to content

gpt-4-all File Analysis

Short description: gpt-4-all refers to a class of conversational models (based on gpt-4 core) that support image analysis, file analysis, and web retrieval.


Overview

  • Method: POST
  • Path: /v1/chat/completions
  • Content-Type: application/json

Authentication

Supports common header-based authentication:

  • OpenAI: Authorization: Bearer sk-xxx
  • Anthropic: x-api-key: sk-xxx
  • Google: x-goog-api-key: sk-xxx

Features

  • Image analysis: include an image URL or a data: base64 URL in the content of a messages item; the model will return image understanding results.
  • File analysis: include a file URL followed by a question in the content, e.g. <file_url> <space> <question>. The model will download the file and answer based on its contents.

Request example

Body parameters

ParameterTypeRequiredDescription
modelstringyesModel name, e.g. gpt-4-all
messages<object>yesChat message array, items like `{ role: 'user'
temperaturenumbernoSampling temperature (0-2)
top_pnumbernoNucleus sampling threshold (0-1)
streambooleannoWhether to stream responses
max_tokensnumbernoMax generated tokens

Example (file analysis):

json
{
  "model": "gpt-4-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-4-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-4-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-4-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": "The API to add a domain is documented as follows:\n\n1. **API path**: /domains/add\n2. **HTTP method**: POST\n3. **Parameters**: domain, user_id, type, etc...\n\nSee the docs for example request and response.",
        "role": "assistant"
      }
    }
  ],
  "created": 1724997805,
  "id": "chatcmpl-EqJ6TxTZRW1sUgfFTbATPumIFWzCi",
  "model": "gpt-4",
  "object": "chat.completion",
  "usage": { "completion_tokens": 292, "prompt_tokens": 13, "total_tokens": 305 },
  "system_fingerprint": "fp_example"
}