Skip to main content
POST
/
v1
/
responses
gpt-4.1 (file analysis)
curl --request POST \
  --url https://api.example.com/v1/responses
OpenAI’s official format(response) for the file analysis API.
curl --location 'https://gptproto.com/v1/responses' \
--header 'Authorization: sk-*****' \
--header 'Content-Type: application/json' \
--data '{
    "model": "gpt-4.1",
    "input": [
        {
            "role": "user",
            "content": [
                {
                    "type": "input_text",
                    "text": "Please analyze this PDF document and provide a summary of its content"
                },
                {
                    "type": "input_file",
                    "file_url": "https://oss.heyoos.com/ai-draw/material/Essential-English.pdf"
                }
            ]
        }
    ]
}'
{
  "id": "resp-abc123",
  "object": "response",
  "created": 1699896916,
  "model": "gpt-4.1",
  "output": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Financial Report Q3 2024\n- Total Pages: 45\n- Date: September 30, 2024\n\n## Main Topics:\n1. **Revenue Growth**: The company reported a 23% increase in quarterly revenue, reaching $4.2 billion\n2. **Market Expansion**: Successfully entered three new international markets in Asia-Pacific region\n3. **Product Innovation**: Launched two major product lines with positive customer reception\n4. **Operational Efficiency**: Reduced operational costs by 15% through process optimization\n\n## Financial Highlights:\n- Total Revenue: $4.2B (↑23% YoY)\n- Net Income: $850M (↑18% YoY)\n- Operating Margin: 28.5%\n- Cash Flow: $1.1B positive\n\n## Strategic Initiatives:\n- Investment in R&D increased by 30%\n- New partnership agreements with 5 major technology companies\n- Sustainability goals on track with 40% reduction in carbon emissions\n\n## Future Outlook:\nThe company maintains a positive outlook for Q4 2024, projecting continued growth driven by strong product demand and market expansion efforts.",
  "usage": {
    "prompt_tokens": 3500,
    "completion_tokens": 245,
    "total_tokens": 3745
  }
}

Parameters

ParameterTypeRequiredDefaultDescription
modelstring✅ Yesgpt-4.1The model to use for the request. Must support file analysis capabilities.
inputarray✅ Yes-Array of message objects with role and content. Each message contains: - role: “user” or “assistant” - content: Array of content objects supporting the following types: - input_text: Text prompt with text field - input_file: File input with file_url field, supports: - Direct URL to publicly accessible files: https://oss.heyoos.com/ai-draw/material/Essential-English.pdf - Base64 encoded files: data:{mime-type};base64,{base64_string} - Supported formats: PDF, DOCX, XLSX, TXT, CSV, JSON, XML, HTML - Maximum file size: 20MB Example with direct file URL: json [ { "role": "user", "content": [ { "type": "input_text", "text": "Please analyze this file and extract the key information" }, { "type": "input_file", "file_url": "https://oss.heyoos.com/ai-draw/material/Essential-English.pdf" } ] } ]
streamboolean❌ NofalseWhether to stream the response