# Qwen-Plus - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Alibaba/qwen-plus/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Experience advanced qwen plus for intelligent text to text generation. Boost productivity with smart drafting, summarization, and creative writing at scale. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "qwen-plus", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "qwen-plus", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "qwen-plus", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "qwen-plus", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `qwen-3.5`. Alibaba offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------------ | -------------- | -------- | ------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. | | `n` | integer / null | ❌ No | `1` | `1` - `10` | How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. | | `response_format` | object | ❌ No | - | - | An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. | | `>response_format.type` | string | ✅ Yes | `text` | `text`
`json_object` | The type of response format. `text` for standard text output, `json_object` for JSON mode. | | `tools` | array | ❌ No | - | - | A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. | | `>tools.type` | string | ✅ Yes | - | `function` | The type of the tool. Currently, only `function` is supported. | | `>tools.function` | object | ✅ Yes | - | - | The function definition. | | `>>tools.function.name` | string | ✅ Yes | - | - | The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. | | `>>tools.function.description` | string | ❌ No | - | - | A description of what the function does, used by the model to choose when and how to call the function. | | `>>tools.function.parameters` | object | ❌ No | - | - | The parameters the functions accepts, described as a JSON Schema object. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Response Example ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "{{model}}", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The image shows a wooden boardwalk path extending through a lush green grassland." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1250, "completion_tokens": 89, "total_tokens": 1339 } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Qwen-Turbo - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Alibaba/qwen-turbo/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Leverage qwen turbo for lightning-fast text to text responses. Perfect for high-volume automated content, quick queries, and efficient real-time interactions. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "qwen-turbo", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "qwen-turbo", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "qwen-turbo", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "qwen-turbo", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `qwen-3.5`. Alibaba offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------------ | -------------- | -------- | ------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. | | `n` | integer / null | ❌ No | `1` | `1` - `10` | How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. | | `response_format` | object | ❌ No | - | - | An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. | | `>response_format.type` | string | ✅ Yes | `text` | `text`
`json_object` | The type of response format. `text` for standard text output, `json_object` for JSON mode. | | `tools` | array | ❌ No | - | - | A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. | | `>tools.type` | string | ✅ Yes | - | `function` | The type of the tool. Currently, only `function` is supported. | | `>tools.function` | object | ✅ Yes | - | - | The function definition. | | `>>tools.function.name` | string | ✅ Yes | - | - | The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. | | `>>tools.function.description` | string | ❌ No | - | - | A description of what the function does, used by the model to choose when and how to call the function. | | `>>tools.function.parameters` | object | ❌ No | - | - | The parameters the functions accepts, described as a JSON Schema object. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Response Example ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "{{model}}", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The image shows a wooden boardwalk path extending through a lush green grassland." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1250, "completion_tokens": 89, "total_tokens": 1339 } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Qwen3-Max - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Alibaba/qwen3-max/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Unleash the power of qwen3 max for complex text to text tasks. Superior reasoning and deep context understanding for professional-grade AI content creation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "qwen3-max", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "qwen3-max", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "qwen3-max", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "qwen3-max", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `qwen-3.5`. Alibaba offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------------ | -------------- | -------- | ------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. | | `n` | integer / null | ❌ No | `1` | `1` - `10` | How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. | | `response_format` | object | ❌ No | - | - | An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. | | `>response_format.type` | string | ✅ Yes | `text` | `text`
`json_object` | The type of response format. `text` for standard text output, `json_object` for JSON mode. | | `tools` | array | ❌ No | - | - | A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. | | `>tools.type` | string | ✅ Yes | - | `function` | The type of the tool. Currently, only `function` is supported. | | `>tools.function` | object | ✅ Yes | - | - | The function definition. | | `>>tools.function.name` | string | ✅ Yes | - | - | The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. | | `>>tools.function.description` | string | ❌ No | - | - | A description of what the function does, used by the model to choose when and how to call the function. | | `>>tools.function.parameters` | object | ❌ No | - | - | The parameters the functions accepts, described as a JSON Schema object. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Response Example ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "{{model}}", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The image shows a wooden boardwalk path extending through a lush green grassland." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1250, "completion_tokens": 89, "total_tokens": 1339 } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Wan-2.5-Preview - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Alibaba/wan-2.5-preview/gptproto-format/image-edit POST /api/v3/alibaba/wan-2.5-preview/image-edit Transform your visuals with wan 2.5 preview. Professional image edit tools for seamless object removal, style changes, and precision artistic adjustments. Edit and transform images based on text prompts using Qwen's wan-2.5-preview model with GPTProto format API. ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/alibaba/wan-2.5-preview/image-edit' \ --header 'Authorization: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Turn into ghibli style.", "images": [ "https://oss.gptproto.com//gptproto/images-6e236488-506a-4978-8b6a-39adb68206f3.jpeg" ], "size": "1280*1786", "seed": -1 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/alibaba/wan-2.5-preview/image-edit" headers = { "Authorization": "YOUR_API_KEY", "Content-Type": "application/json" } data = { "prompt": "Turn into ghibli style.", "images": [ "https://oss.gptproto.com//gptproto/images-6e236488-506a-4978-8b6a-39adb68206f3.jpeg" ], "size": "1280*1786", "seed": -1 } response = requests.post(url, headers=headers, json=data) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/alibaba/wan-2.5-preview/image-edit"; const headers = { "Authorization": "YOUR_API_KEY", "Content-Type": "application/json" }; const data = { "prompt": "Turn into ghibli style.", "images": [ "https://oss.gptproto.com//gptproto/images-6e236488-506a-4978-8b6a-39adb68206f3.jpeg" ], "size": "1280*1786", "seed": -1 }; fetch(url, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/alibaba/wan-2.5-preview/image-edit" payload := []byte(`{ "prompt": "Turn into ghibli style.", "images": [ "https://oss.gptproto.com//gptproto/images-6e236488-506a-4978-8b6a-39adb68206f3.jpeg" ], "size": "1280*1786", "seed": -1 }`) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload)) req.Header.Set("Authorization", "YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Response ```json 200 - Success theme={null} { "data": { "id": "abc123def456", "model": "alibaba/wan-2.5-preview/image-edit", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc123def456/result" }, "status": "created", "createdAt": "2025-12-01T10:00:00.000Z", "error": "", "executionTime": 0 }, "message": "success", "code": 200 } ``` ```json 401 - Invalid signature theme={null} { "error": { "message": "Invalid signature", "type": "401" } } ``` ```json 403 - Insufficient balance theme={null} { "error": { "message": "Insufficient balance", "type": "403" } } ``` ```json 500 - Internal server error theme={null} { "error": { "message": "Internal server error", "type": "500" } } ``` ```json 503 - Content policy violation theme={null} { "error": { "message": "Input may not meet the guidelines. Please adjust and try again.", "type": "503" } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | --------- | ------- | -------- | ------- | ----------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | Text description of the desired image transformation or editing instructions | | `images` | array | ✅ Yes | - | Array of image URLs to be edited. Supports one or multiple input images | | `size` | string | ❌ No | - | The size of the output image in pixels (width*height), e.g., "1280*1786" | | `seed` | integer | ❌ No | `-1` | Random seed for generation reproducibility. Set to `-1` for random generation | # Wan-2.5-Preview - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Alibaba/wan-2.5-preview/gptproto-format/image-to-video POST /api/v3/alibaba/wan-2.5-preview/image-to-video-fast Animate static shots using wan 2.5 preview image to video technology. Create cinematic motion and high-fidelity video clips from any single source image. Qwen's GPTProto format for the image to video API. ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/alibaba/wan-2.5-preview/image-to-video' \ --header 'Authorization: sk-xx' \ --header 'Content-Type: application/json' \ --data '{ "image": "https://d1q70pf5vjeyhc.cloudfront.net/media/fb8f674bbb1a429d947016fd223cfae1/images/1758532447268876299_CLRNKHEA.jpeg", "audio": "", "prompt": "A confident woman in her 40s stands on a stage with a microphone. The background shows a large LED screen with abstract visuals. She smiles and begins speaking to the audience: “Good evening everyone. Tonight, I want to share three powerful lessons about leadership and innovation.” Her lip movements match her voice, and she uses expressive hand gestures while speaking.", "negative_prompt": "", "resolution": "720p", "duration": 5, "enable_prompt_expansion": false, "seed": -1 }' ``` ```json 401 - Invalid signature theme={null} { "error": { "message": "Invalid signature", "type": "401" } } ``` ```json 403 - Insufficient balance theme={null} { "error": { "message": "Insufficient balance", "type": "403" } } ``` ```json 500 - Internal server error theme={null} { "error": { "message": "Internal server error", "type": "500" } } ``` ```json 503 - Content policy violation theme={null} { "error": { "message": "Input may not meet the guidelines. Please adjust and try again.", "type": "503" } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------------------- | ------- | -------- | ------- | -------------------------------------------------------------------------------------------------- | | `image` | string | ✅ Yes | - | The image for generating the output. | | `audio` | string | ❌ No | - | Audio URL to guide generation (optional). | | `prompt` | string | ✅ Yes | - | The positive prompt for the generation. | | `negative_prompt` | string | ✅ Yes | - | The negative prompt for the generation. | | `resolution` | string | ❌ No | `720p` | 480p, 720p, 1080p . The resolution of the generated media. | | `duration` | integer | ❌ No | `5` | 3, 4, 5, 6, 7, 8, 9, 10 . The duration of the generated media in seconds. | | `enable_prompt_expansion` | boolean | ❌ No | `false` | If set to true, the prompt optimizer will be enabled. | | `seed` | integer | ❌ No | `-1` | -1 \~ 2147483647 . The random seed to use for the generation. -1 means a random seed will be used. | ```json theme={null} { "data": { "id": "5d87273c75exxxx", "model": "alibaba/wan-2.5-preview/image-to-video", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/5d87273c75exxxx/result" }, "hasNsfwContents": [], "status": "created", "createdAt": "2025-11-10T09:50:05.977Z", "error": "", "executionTime": 0, "timings": { "inference": 0 } }, "message": "success", "code": 200 } ``` # Wan-2.5-Preview - Query Task - gptproto Source: https://docs.gptproto.com/docs/allapi/Alibaba/wan-2.5-preview/gptproto-format/query-task GET /api/v3/predictions/{task_id}/result Optimize complex workflows with wan 2.5 preview query task capabilities. Precise data extraction and logical analysis for demanding technical requirements. Qwen's GPTProto format for the query task API. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{task_id}/result" \ -H "Authorization: sk-***********" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{task_id}/result" headers = { "Authorization": "sk-***********", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{task_id}/result"; const headers = { "Authorization": "sk-***********", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{task_id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "sk-***********") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ```json 200 - Success theme={null} { "status": "success", "result": {} } ``` ```json 401 - Invalid signature theme={null} { "error": { "message": "Invalid signature", "type": "401" } } ``` ```json 403 - Insufficient balance theme={null} { "error": { "message": "Insufficient balance", "type": "403" } } ``` ```json 500 - Internal server error theme={null} { "error": { "message": "Internal server error", "type": "500" } } ``` ```json 503 - Content policy violation theme={null} { "error": { "message": "Input may not meet the guidelines. Please adjust and try again.", "type": "503" } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------------------ | ------ | -------- | ------- | ------------------------------------------------ | | `Authorization` (Header) | string | ✅ Yes | - | Your API key in the format: `sk-***********` | | `task_id` (Path) | string | ✅ Yes | - | The task ID returned from the generation request | # Wan-2.5-Preview - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Alibaba/wan-2.5-preview/gptproto-format/text-to-image POST /api/v3/alibaba/wan-2.5-preview/text-to-image Generate stunning visuals with wan 2.5 preview text to image. Turn descriptive prompts into high-resolution, photorealistic digital art and illustrations. Generate images from text prompts using Qwen's wan-2.5-preview model with GPTProto format API. ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/alibaba/wan-2.5-preview/text-to-image' \ --header 'Authorization: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "a cat", "size": "1024*1024", "resolution": "720p", "enable_prompt_expansion": "false", "negative_prompt": "", "seed": -1 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/alibaba/wan-2.5-preview/text-to-image" headers = { "Authorization": "YOUR_API_KEY", "Content-Type": "application/json" } data = { "prompt": "a cat", "size": "1024*1024", "resolution": "720p", "enable_prompt_expansion": "false", "negative_prompt": "", "seed": -1 } response = requests.post(url, headers=headers, json=data) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/alibaba/wan-2.5-preview/text-to-image"; const headers = { "Authorization": "YOUR_API_KEY", "Content-Type": "application/json" }; const data = { "prompt": "a cat", "size": "1024*1024", "resolution": "720p", "enable_prompt_expansion": "false", "negative_prompt": "", "seed": -1 }; fetch(url, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/alibaba/wan-2.5-preview/text-to-image" payload := []byte(`{ "prompt": "a cat", "size": "1024*1024", "resolution": "720p", "enable_prompt_expansion": "false", "negative_prompt": "", "seed": -1 }`) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload)) req.Header.Set("Authorization", "YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Response ```json 200 - Success theme={null} { "data": { "id": "5d87273c75ea40f19a34dea994276673", "model": "alibaba/wan-2.5-preview/text-to-image", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/5d87273c75ea40f19a34dea994276673/result" }, "hasNsfwContents": [], "status": "created", "createdAt": "2025-11-10T09:50:05.977Z", "error": "", "executionTime": 0, "timings": { "inference": 0 } }, "message": "success", "code": 200 } ``` ```json 401 - Invalid signature theme={null} { "error": { "message": "Invalid signature", "type": "401" } } ``` ```json 403 - Insufficient balance theme={null} { "error": { "message": "Insufficient balance", "type": "403" } } ``` ```json 500 - Internal server error theme={null} { "error": { "message": "Internal server error", "type": "500" } } ``` ```json 503 - Content policy violation theme={null} { "error": { "message": "Input may not meet the guidelines. Please adjust and try again.", "type": "503" } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | -------- | ------------- | ------------------------- | -------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | Text description for the image generation | | `size` | string | ❌ No | `"1024*1024"` | 768 \~ 1440 per dimension | The size of the generated image in pixels (width\*height) | | `resolution` | string | ❌ No | `"720p"` | - | Output resolution quality setting | | `enable_prompt_expansion` | string | ❌ No | `"false"` | - | Enable automatic prompt expansion and optimization. Set to `"true"` or `"false"` | | `negative_prompt` | string | ❌ No | `""` | - | Negative prompt to specify what should not appear in the generated image | | `seed` | integer | ❌ No | `-1` | `-1` \~ `2147483647` | Random seed for generation reproducibility. Set to `-1` for random generation | # Wan-2.5-Preview - Text To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Alibaba/wan-2.5-preview/gptproto-format/text-to-video POST /api/v3/alibaba/wan-2.5-preview/text-to-video Bring stories to life with wan 2.5 preview text to video. High-quality cinematic generation with consistent characters and fluid motion from text prompts. Generate videos from text prompts using Qwen's wan-2.5-preview model with GPTProto format API. ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/alibaba/wan-2.5-preview/text-to-video' \ --header 'Authorization: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "a cat", "negative_prompt": "", "audio": "", "size": "1280*720", "duration": "5", "enable_prompt_expansion": "false", "seed": -1 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/alibaba/wan-2.5-preview/text-to-video" headers = { "Authorization": "YOUR_API_KEY", "Content-Type": "application/json" } data = { "prompt": "a cat", "negative_prompt": "", "audio": "", "size": "1280*720", "duration": "5", "enable_prompt_expansion": "false", "seed": -1 } response = requests.post(url, headers=headers, json=data) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/alibaba/wan-2.5-preview/text-to-video"; const headers = { "Authorization": "YOUR_API_KEY", "Content-Type": "application/json" }; const data = { "prompt": "a cat", "negative_prompt": "", "audio": "", "size": "1280*720", "duration": "5", "enable_prompt_expansion": "false", "seed": -1 }; fetch(url, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/alibaba/wan-2.5-preview/text-to-video" payload := []byte(`{ "prompt": "a cat", "negative_prompt": "", "audio": "", "size": "1280*720", "duration": "5", "enable_prompt_expansion": "false", "seed": -1 }`) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload)) req.Header.Set("Authorization", "YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Response ```json 200 - Success theme={null} { "task_id": "abc123def456", "status": "processing", "message": "Video generation task submitted successfully" } ``` ```json 401 - Invalid signature theme={null} { "error": { "message": "Invalid signature", "type": "401" } } ``` ```json 403 - Insufficient balance theme={null} { "error": { "message": "Insufficient balance", "type": "403" } } ``` ```json 500 - Internal server error theme={null} { "error": { "message": "Internal server error", "type": "500" } } ``` ```json 503 - Content policy violation theme={null} { "error": { "message": "Input may not meet the guidelines. Please adjust and try again.", "type": "503" } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------------------- | ------- | -------- | ------------ | --------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | Text description for the video generation, describing the desired scene, actions, and style | | `negative_prompt` | string | ❌ No | `""` | Negative prompt to specify what should not appear in the generated video. Leave empty if not needed | | `audio` | string | ❌ No | `""` | URL of the audio file to be added to the generated video. Leave empty for no audio | | `size` | string | ❌ No | `"1280*720"` | Video resolution/size. Format: width\*height (e.g., `1280*720`, `1920*1080`) | | `duration` | string | ❌ No | `"5"` | Duration of the generated video in seconds | | `enable_prompt_expansion` | string | ❌ No | `"false"` | Enable automatic prompt expansion and optimization. Set to `"true"` or `"false"` | | `seed` | integer | ❌ No | `-1` | Random seed for generation reproducibility. Set to `-1` for random generation | # Claude-Haiku-4-5-20251001 - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-haiku-4-5-20251001/official-format/file-analysis POST https://gptproto.com/v1/messages Fast and accurate claude haiku 4.5 file analysis. Instantly extract insights, summarize long documents, and process data from various file formats. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Haiku-4-5-20251001 - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-haiku-4-5-20251001/official-format/text-to-text POST https://gptproto.com/v1/messages Get instant answers with claude haiku 4.5 text to text. The perfect balance of speed and intelligence for daily tasks, chatting, and concise drafting. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Haiku-4-5-20251001 - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-haiku-4-5-20251001/official-format/web-search POST https://gptproto.com/v1/messages Explore the live web with claude haiku 4.5 web search. Access real-time information and get cited answers for your latest research and news queries. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Haiku-4-5-20251001 - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-haiku-4-5-20251001/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Optimize data processing with claude haiku 4.5 file analysis. Efficient document parsing and information retrieval for streamlined professional workflows. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Haiku-4-5-20251001 - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-haiku-4-5-20251001/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Responsive and clever claude haiku 4.5 text to text. Ideal for developers and creators needing quick, reliable AI interaction and content generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Haiku-4-5-20251001 - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-haiku-4-5-20251001/openai-format/web-search POST https://gptproto.com/v1/chat/completions Stay updated with claude haiku 4.5 web search. Combine fast processing with real-time internet access for accurate, up-to-the-minute information. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-haiku-4-5-20251001", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805-Thinking - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805-thinking/official-format/file-analysis POST https://gptproto.com/v1/messages Deep claude opus 4.1 thinking for complex file analysis. Advanced reasoning for technical audits, code reviews, and multifaceted document synthesis. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805-Thinking - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805-thinking/official-format/text-to-text POST https://gptproto.com/v1/messages Engage with claude opus 4.1 thinking for elite text to text reasoning. Solves difficult problems and provides nuanced, highly sophisticated AI responses. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805-Thinking - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805-thinking/official-format/web-search POST https://gptproto.com/v1/messages Comprehensive research via claude opus 4.1 thinking web search. Analyzes live data with deep logical layers to provide the most thorough answers online. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805-Thinking - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805-thinking/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Master intricate data with claude opus 4.1 thinking file analysis. Exceptional at finding hidden patterns in massive datasets and technical documentation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805-Thinking - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805-thinking/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Advanced logic meets claude opus 4.1 thinking text to text. Perfect for high-level strategy, complex coding, and nuanced academic writing assistance. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805-Thinking - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805-thinking/openai-format/web-search POST https://gptproto.com/v1/chat/completions Navigate the internet with claude opus 4.1 thinking web search. Deeply reasoned insights from current sources for professional-grade market intelligence. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805 - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805/official-format/file-analysis POST https://gptproto.com/v1/messages High-performance claude opus 4.1 file analysis. Securely upload and analyze complex spreadsheets, PDFs, and legal documents with expert-level precision. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805 - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805/official-format/text-to-text POST https://gptproto.com/v1/messages The gold standard claude opus 4.1 text to text. Exceptional creative writing, coding, and problem-solving for users who demand the very best AI quality. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805 - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805/official-format/web-search POST https://gptproto.com/v1/messages Detailed answers with claude opus 4.1 web search. Integrated browsing allows for authoritative responses based on current global events and data. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805 - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Unlock document insights with claude opus 4.1 file analysis. Professional-grade extraction and summarization for business and technical researchers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805 - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Experience the versatility of claude opus 4.1 text to text. A premium AI partner for complex creative projects and detailed technical documentation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-1-20250805 - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-1-20250805/openai-format/web-search POST https://gptproto.com/v1/chat/completions Fact-check and research with claude opus 4.1 web search. Powerful internet-enabled AI that provides context-rich and cited information instantly. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-1-20250805", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-5-20251101 - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-5-20251101/official-format/file-analysis POST https://gptproto.com/v1/messages Next-gen claude opus 4.5 file analysis. Effortlessly handle large-scale document reviews and extract critical business intelligence from complex files. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-5-20251101 - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-5-20251101/official-format/text-to-text POST https://gptproto.com/v1/messages Elite claude opus 4.5 text to text generation. State-of-the-art performance for highly nuanced creative work, strategic planning, and complex coding. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-5-20251101 - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-5-20251101/official-format/web-search POST https://gptproto.com/v1/messages Search the web like a pro with claude opus 4.5 web search. Highly accurate, real-time data synthesis for the most demanding research tasks. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-5-20251101", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-5-20251101 - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-5-20251101/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Advanced claude opus 4.5 file analysis for professionals. Deep-dive into technical papers and financial reports with unmatched accuracy and speed. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-5-20251101 - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-5-20251101/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Unrivaled quality with claude opus 4.5 text to text. The most sophisticated AI model for natural dialogue and high-stakes content generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-5-20251101 - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-5-20251101/openai-format/web-search POST https://gptproto.com/v1/chat/completions Master real-time information with claude opus 4.5 web search. Delivers precise, cited, and up-to-date answers for any professional or academic query. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-5-20251101", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6-Thinking - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6-thinking/official-format/file-analysis POST https://gptproto.com/v1/messages Supreme reasoning in claude opus 4.6 thinking file analysis. Exceptional handling of complex logic, technical data, and massive documentation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6-Thinking - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6-thinking/official-format/text-to-text POST https://gptproto.com/v1/messages Top-tier claude opus 4.6 thinking text to text. Solves the hardest logic puzzles and creates highly sophisticated content with deep reasoning chains. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6-Thinking - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6-thinking/official-format/web-search POST https://gptproto.com/v1/messages In-depth research via claude opus 4.6 thinking web search. Connects current internet data with advanced logic for the ultimate investigative AI tool. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6-Thinking - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6-thinking/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Precision audits with claude opus 4.6 thinking file analysis. The smarter way to digest technical manuals and multi-layered data structures. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6-Thinking - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6-thinking/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Sophisticated claude opus 4.6 thinking text to text for power users. Deeply reflective AI that considers every angle of your prompt for perfect results. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6-Thinking - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6-thinking/openai-format/web-search POST https://gptproto.com/v1/chat/completions Advanced internet intelligence with claude opus 4.6 thinking web search. Real-time sourcing combined with superior logical analysis for verified answers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6 - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6/official-format/file-analysis POST https://gptproto.com/v1/messages Seamless claude opus 4.6 file analysis. Process and understand complex files, from codebases to legal contracts, with industry-leading accuracy. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6 - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6/official-format/text-to-text POST https://gptproto.com/v1/messages Powerful claude opus 4.6 text to text for every task. High-fidelity responses, creative excellence, and professional-grade technical assistance. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6 - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6/official-format/web-search POST https://gptproto.com/v1/messages Real-time connectivity with claude opus 4.6 web search. High-speed browsing and synthesis for accurate information on trending topics and research. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6 - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Extract value from data with claude opus 4.6 file analysis. Reliable, high-context document processing for researchers and business analysts. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6 - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Premium AI experience with claude opus 4.6 text to text. Sophisticated writing, coding, and multilingual support for high-end professional needs. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Opus-4-6 - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-6/openai-format/web-search POST https://gptproto.com/v1/chat/completions Accurate and timely claude opus 4.6 web search. Your window to the world's information, synthesized by the most capable AI model available. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-6", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7-thinking (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7-thinking/official-format/file-analysis POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7-thinking (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7-thinking/official-format/text-to-text POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7-thinking (Web Search) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7-thinking/official-format/web-search POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7-thinking (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7-thinking/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7-thinking (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7-thinking/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7-thinking (Web Search) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7-thinking/openai-format/web-search POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7 (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7/official-format/file-analysis POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7 (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7/official-format/text-to-text POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7 (Web Search) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7/official-format/web-search POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7 (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7 (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-7 (Web Search) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-7/openai-format/web-search POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-7", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8-thinking (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8-thinking/official-format/file-analysis POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8-thinking (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8-thinking/official-format/text-to-text POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8-thinking (Web Search) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8-thinking/official-format/web-search POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8-thinking (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8-thinking/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8-thinking (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8-thinking/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8-thinking (Web Search) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8-thinking/openai-format/web-search POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8 (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8/official-format/file-analysis POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8 (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8/official-format/text-to-text POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8 (Web Search) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8/official-format/web-search POST https://gptproto.com/v1/messages ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8 (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8 (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # claude-opus-4-8 (Web Search) Source: https://docs.gptproto.com/docs/allapi/Claude/claude-opus-4-8/openai-format/web-search POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-opus-4-8", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514-Thinking - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514-thinking/official-format/file-analysis POST https://gptproto.com/v1/messages Smart claude sonnet 4 thinking file analysis. Balanced speed and reasoning for effective document summarization and technical data extraction. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514-Thinking - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514-thinking/official-format/text-to-text POST https://gptproto.com/v1/messages Intelligent claude sonnet 4 thinking text to text. A deep-thinking AI that delivers high-quality content and logical problem-solving for daily work. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514-Thinking - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514-thinking/official-format/web-search POST https://gptproto.com/v1/messages Efficient claude sonnet 4 thinking web search. Real-time internet access paired with thoughtful analysis for well-rounded and accurate search results. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514-Thinking - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514-thinking/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Analyze files faster with claude sonnet 4 thinking. Smart document processing that understands context and provides reliable technical insights. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514-Thinking - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514-thinking/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Versatile claude sonnet 4 thinking text to text. Ideal for brainstorming, drafting, and complex tasks requiring a thoughtful, logical approach. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514-Thinking - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514-thinking/openai-format/web-search POST https://gptproto.com/v1/chat/completions Current insights with claude sonnet 4 thinking web search. Reliable browsing for research and news, synthesized with advanced reasoning capabilities. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514 - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514/official-format/file-analysis POST https://gptproto.com/v1/messages High-speed claude sonnet 4 file analysis. Quick processing of PDFs and documents for rapid data extraction and summary generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514 - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514/official-format/text-to-text POST https://gptproto.com/v1/messages Dynamic claude sonnet 4 text to text for creative and professional use. Fast, intelligent, and highly capable for any writing or coding task. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514 - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514/official-format/web-search POST https://gptproto.com/v1/messages Explore live data with claude sonnet 4 web search. Quick, accurate, and cited answers from the web for your daily information needs. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514 - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Professional claude sonnet 4 file analysis. Securely process and interpret documents to streamline your research and data workflows. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514 - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Boost your output with claude sonnet 4 text to text. The reliable AI companion for writing, editing, and interactive problem solving. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-20250514 - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-20250514/openai-format/web-search POST https://gptproto.com/v1/chat/completions Real-time web browsing with claude sonnet 4 web search. Stay informed with cited sources and high-speed information synthesis. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929-Thinking - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929-thinking/official-format/file-analysis POST https://gptproto.com/v1/messages Advanced claude sonnet 4.5 thinking file analysis. Superior document understanding for complex technical and analytical project requirements. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929-Thinking - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929-thinking/official-format/text-to-text POST https://gptproto.com/v1/messages Enhanced claude sonnet 4.5 thinking text to text. Delivers thoughtful, logical, and high-quality responses for sophisticated content generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929-Thinking - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929-thinking/official-format/web-search POST https://gptproto.com/v1/messages Smart browsing with claude sonnet 4.5 thinking web search. Deeply reasoned internet research for the most accurate and up-to-date answers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929-Thinking - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929-thinking/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Insightful claude sonnet 4.5 thinking file analysis. Master your documents with deep contextual understanding and precise data extraction. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929-Thinking - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929-thinking/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Logical excellence in claude sonnet 4.5 thinking text to text. Perfect for complex instructions and high-level creative collaborations. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929-Thinking - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929-thinking/openai-format/web-search POST https://gptproto.com/v1/chat/completions In-depth internet insights with claude sonnet 4.5 thinking web search. Combines real-time data with thoughtful AI reasoning for better results. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929 - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929/official-format/file-analysis POST https://gptproto.com/v1/messages Rapid and reliable claude sonnet 4.5 file analysis. Turn complex documents into actionable insights with professional-grade AI accuracy. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929 - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929/official-format/text-to-text POST https://gptproto.com/v1/messages Premium claude sonnet 4.5 text to text for all needs. Exceptional writing, coding, and general intelligence for any creative or professional task. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929 - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929/official-format/web-search POST https://gptproto.com/v1/messages Live information via claude sonnet 4.5 web search. Accurate research and fast answers with direct citations from across the web. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929 - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Effortless claude sonnet 4.5 file analysis. The efficient way to manage and summarize large volumes of document data and technical files. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929 - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Scale your creativity with claude sonnet 4.5 text to text. A fast, smart, and versatile AI model for modern content and code generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-5-20250929 - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-5-20250929/openai-format/web-search POST https://gptproto.com/v1/chat/completions High-speed internet research with claude sonnet 4.5 web search. Get the facts fast with real-time browsing and intelligent data synthesis. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-5-20250929", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6-Thinking - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6-thinking/official-format/file-analysis POST https://gptproto.com/v1/messages Master-level claude sonnet 4.6 thinking file analysis. Deep reasoning applied to document parsing for unmatched analytical precision. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6-Thinking - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6-thinking/official-format/text-to-text POST https://gptproto.com/v1/messages Superior claude sonnet 4.6 thinking text to text. High-IQ content generation that handles complex logic and nuanced prompts with ease. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6-Thinking - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6-thinking/official-format/web-search POST https://gptproto.com/v1/messages Next-level research via claude sonnet 4.6 thinking web search. Deep reasoning meets real-time web access for the ultimate truth-finding tool. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6-thinking", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6-Thinking - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6-thinking/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Technical precision in claude sonnet 4.6 thinking file analysis. The smartest way to analyze complex files and extract critical data. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6-Thinking - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6-thinking/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Intelligent collaboration with claude sonnet 4.6 thinking text to text. Deep reasoning for coding, creative writing, and strategic analysis. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6-Thinking - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6-thinking/openai-format/web-search POST https://gptproto.com/v1/chat/completions Sophisticated browsing with claude sonnet 4.6 thinking web search. Fact-based, reasoned answers from the most current internet sources. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6-thinking", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6 - File Analysis Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6/official-format/file-analysis POST https://gptproto.com/v1/messages Professional claude sonnet 4.6 file analysis. High-performance document understanding and data extraction for researchers and businesses. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "document", "source": { "type": "url", "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6 - Text To Text Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6/official-format/text-to-text POST https://gptproto.com/v1/messages Versatile and smart claude sonnet 4.6 text to text. The reliable choice for high-quality writing, efficient coding, and interactive AI tasks. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Who are you?" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6 - Web Search Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6/official-format/web-search POST https://gptproto.com/v1/messages Stay ahead with claude sonnet 4.6 web search. Real-time web access and intelligent synthesis for accurate, cited, and timely information. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/messages' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/messages', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/messages" payload = json.dumps({ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json', 'anthropic-version': '2023-06-01' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/messages" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") req.Header.Add("anthropic-version", "2023-06-01") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "msg_abcd", "type": "message", "role": "assistant", "model": "", "content": [ { "type": "text", "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 11, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 67, "cache_creation": {}, "claude_cache_creation_5_m_tokens": 0, "claude_cache_creation_1_h_tokens": 0 } } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | - | The model identifier. Use `claude-opus-4-6` for this model | | `messages` | array | ✅ Yes | - | - | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks) | | `max_tokens` | integer | ✅ Yes | - | 1-64000 | Maximum number of tokens to generate. The model may stop before reaching this limit | | `tools` | array | ✅ Yes | - | - | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305` | | `temperature` | number | ❌ No | `1.0` | 0.0-1.0 | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic | | `top_p` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature | | `top_k` | integer | ❌ No | - | >0 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only | | `stream` | boolean | ❌ No | `false` | - | Whether to stream the response incrementally using server-sent events | | `stop_sequences` | array | ❌ No | - | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Range | Description | | --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | | `role` | string | ✅ Yes | - | The role of the message. Can be: `user` or `assistant` | | `content` | string/array | ✅ Yes | - | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content | ### Content Block Structure (when content is an array) | Field | Type | Required | Range | Description | | ------ | ------ | -------- | ----- | ---------------- | | `type` | string | ✅ Yes | - | Must be `text` | | `text` | string | ✅ Yes | - | The text content | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Range | Description | | ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of tool. Must be `web_search_20250305` for web search | | `name` | string | ✅ Yes | - | The name of the tool. Use `web_search` | | `max_uses` | integer | ❌ No | 1-10 | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | - | Only include search results from these domains. Cannot be used with `blocked_domains` | | `blocked_domains` | array | ❌ No | - | Never include search results from these domains. Cannot be used with `allowed_domains` | | `user_location` | object | ❌ No | - | Localize search results based on user's location | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request * Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console #### User Location Structure The `user_location` object allows you to localize search results based on a user's location: | Field | Type | Required | Range | Description | | ---------- | ------ | -------- | ----- | -------------------------------------------------- | | `type` | string | ✅ Yes | - | The type of location. Must be `approximate` | | `city` | string | ✅ Yes | - | The city name (e.g., `San Francisco`) | | `region` | string | ✅ Yes | - | The region or state (e.g., `California`) | | `country` | string | ✅ Yes | - | The country code (e.g., `US`) | | `timezone` | string | ✅ Yes | - | The IANA timezone ID (e.g., `America/Los_Angeles`) | #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"], "user_location": { "type": "approximate", "city": "San Francisco", "region": "California", "country": "US", "timezone": "America/Los_Angeles" } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6 - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Streamline document work with claude sonnet 4.6 file analysis. Accurate summaries and data extraction for all your professional files. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Please analyze this PDF document and provide a summary of its content" }, { "type": "file", "file": { "filename": "gptproto.pdf", "file_data": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "max_tokens": 1000, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6 - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Boost productivity with claude sonnet 4.6 text to text. Fast, reliable AI that excels at creative projects and complex technical tasks. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": "Who are you?" } ], "max_tokens": 1024, "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Claude-Sonnet-4-6 - Web Search - openai Source: https://docs.gptproto.com/docs/allapi/Claude/claude-sonnet-4-6/openai-format/web-search POST https://gptproto.com/v1/chat/completions Efficient internet research with claude sonnet 4.6 web search. Your go-to tool for real-time information and comprehensive cited answers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": "What'\''s the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "claude-sonnet-4-6", "messages": [ { "role": "user", "content": "What's the weather in NYC?" } ], "tools": [ { "type": "web_search_20250305", "name": "web_search", "max_uses": 5 } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "claude-opus-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Technical API Documentation\n- Total Pages: 35\n- Version: 2.0\n\n## Main Topics:\n1. **Authentication**: The API uses Bearer token authentication with API keys\n2. **Endpoints**: Contains 12 main API endpoints for different operations\n3. **Rate Limiting**: Implements tiered rate limiting based on subscription level\n4. **Error Handling**: Comprehensive error codes and handling strategies\n\n## Key Sections:\n\n### Getting Started\n- Quick start guide for new developers\n- Authentication setup instructions\n- First API call examples in multiple languages\n\n### API Reference\n- Detailed endpoint documentation\n- Request/response formats\n- Parameter descriptions and constraints\n\n### Best Practices\n- Recommended usage patterns\n- Performance optimization tips\n- Security considerations\n\n### Code Examples\n- Python, JavaScript, Go, and cURL examples\n- Common use case implementations\n- Error handling patterns\n\n## Important Notes:\n- All requests must include valid API key\n- Rate limits: 100 requests/minute for free tier, 1000/minute for premium\n- Support for both JSON and XML response formats\n- Webhook notifications available for asynchronous operations" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 3500, "completion_tokens": 285, "total_tokens": 3785 } } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `claude-opus-4-6` | The model to use for the request | | `messages` | array | ✅ Yes | `[{"role": "user", "content": "What's the weather in NYC?"}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. | | `tools` | array | ✅ Yes | - | Array of tool objects. For web search, must include the web\_search tool configuration. | | `stream` | boolean | ❌ No | `false` | Whether to stream the response | | `temperature` | number | ❌ No | `1.0` | Amount of randomness injected into the response. Ranges from 0.0 to 1.0 | | `top_p` | number | ❌ No | `1.0` | Use nucleus sampling. Ranges from 0.0 to 1.0 | | `max_tokens` | integer | ❌ No | - | The maximum number of tokens to generate before stopping | | `stop` | array | ❌ No | - | Custom text sequences that will cause the model to stop generating | ### Messages Array Structure Each message object in the `messages` array should have the following structure: | Field | Type | Required | Description | | --------- | ------------ | -------- | ----------------------------------------------------------------- | | `role` | string | ✅ Yes | The role of the message. Can be: `user`, `assistant`, or `system` | | `content` | array/string | ✅ Yes | The content of the message | ### Content Array Structure (when content is an array) | Field | Type | Required | Example | Description | | ------ | ------ | -------- | ------------------------------ | ------------------------------------ | | `type` | string | ✅ Yes | `text` | The type of content | | `text` | string | ✅ Yes | `"What's the weather in NYC?"` | The text content when type is `text` | ### Tools Array Structure For web search functionality, the `tools` array should contain a web search tool object: | Field | Type | Required | Example | Description | | ----------------- | ------- | -------- | -------------------------------------- | --------------------------------------------------------------------------- | | `type` | string | ✅ Yes | `web_search` | The type of tool. Must be `web_search` for web search | | `max_uses` | integer | ❌ No | `5` | Maximum number of times the web search tool can be used in a single request | | `allowed_domains` | array | ❌ No | `["example.com", "trusteddomain.org"]` | Only include search results from these domains | | `blocked_domains` | array | ❌ No | `["untrustedsource.com"]` | Never include search results from these domains | #### Max Uses The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web search result will be an error with the `max_uses_exceeded` error code. #### Domain Filtering When using domain filters: * Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`) * Subdomains are automatically included (`example.com` covers `docs.example.com`) * Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`) * Subpaths are supported (`example.com/blog`) * You can use either `allowed_domains` or `blocked_domains`, but not both in the same request #### Complete Tool Configuration Example ```json theme={null} { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["example.com", "trusteddomain.org"] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Deepseek-V3.2 - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/DeepSeek/deepseek-v3.2/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Harness deepseek v3.2 for powerful text to text tasks. Advanced reasoning, high-efficiency coding, and versatile creative content generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "deepseek-v3.2", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "deepseek-v3.2", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "deepseek-v3.2", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "deepseek-v3.2", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `deepseek-v3.2`. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and files. | | `>messages.role` | string | ✅ Yes | - | `system`
`user`
`assistant` | The role of the messages author. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the message. Can be a string for text-only messages or an array for multimodal content. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url`
`file` | The type of the content part. | | `>>messages.content.text` | string | ❌ No | - | - | The text content. | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content. | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image. | | `>>messages.content.file` | object | ❌ No | - | - | The file content for document analysis. | | `>>messages.content.file.filename` | string | ❌ No | - | - | The name of the file. | | `>>messages.content.file.file_data` | string | ❌ No | - | - | The URL of the file. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------- | ------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer | ❌ No | - | - | The maximum number of tokens to generate in the response. | | `temperature` | number | ❌ No | `0.95` | `0.0` - `1.0` | Controls randomness. Lower values make the model more focused and deterministic. | | `top_p` | number | ❌ No | `0.7` | `0.0` - `1.0` | Nucleus sampling parameter. The model considers the results of the tokens with top\_p probability mass. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally using server-sent events. | | `tools` | array | ❌ No | - | - | A list of tools the model may call. Use this to enable web search or function calling capabilities. | | `stop` | array | ❌ No | - | - | Up to 4 sequences where the API will stop generating further tokens. | ## Response Example ```json theme={null} { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699896916, "model": "deepseek-v3.2", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "I am DeepSeek-V3.2, a large language model developed by DeepSeek. I'm designed to assist with a wide range of tasks including answering questions, writing content, analyzing documents, and more." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 45, "total_tokens": 57 } } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedance-1-0-Pro-250528 - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-1-0-pro-250528/gptproto-format/image-to-video POST /api/v3/bytedance/doubao-seedance-1-0-pro-250528/image-to-video Create stunning visuals with doubao seedance 1.0 pro image to video. High-fidelity animation and cinematic motion from any source image. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location --request POST 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-pro-250528/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl'\''s hair is blown by the wind. Wind sounds can be heard.", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", "last_image": "", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": false, "resolution": "480p", "generate_audio": true, "seed": -1 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-pro-250528/image-to-video" headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" } payload = { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard.", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", "last_image": "", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": False, "resolution": "480p", "generate_audio": True, "seed": -1 } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` ```javascript JavaScript theme={null} const axios = require('axios'); const url = 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-pro-250528/image-to-video'; const headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }; const data = { prompt: "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard.", image: "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", last_image: "", duration: 5, aspect_ratio: "1:1", camera_fixed: false, resolution: "480p", generate_audio: true, seed: -1 }; axios.post(url, data, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-pro-250528/image-to-video" payload := map[string]interface{}{ "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard.", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", "last_image": "", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": false, "resolution": "480p", "generate_audio": true, "seed": -1, } jsonData, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) fmt.Println(result) } ``` ## Response Example ```json theme={null} { "data": { "id": "cgt-20251225201409-abc", "model": "doubao-seedance-1-0-pro-250528", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/cgt-20251225201409-abc/result" }, "hasNsfwContents": [], "status": "created", "createdAt": "2025-12-25 20:14:09", "executionTime": 0, "timings": { "inference": 0 } }, "message": "success", "code": 200 } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ### How to obtain the id After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id Use this id (or the complete URL) to poll the endpoint shown above and retrieve the final result. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedance-1-0-Pro-250528 - Text To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-1-0-pro-250528/gptproto-format/text-to-video POST /api/v3/bytedance/doubao-seedance-1-0-pro-250528/text-to-video Transform prompts into movies with doubao seedance 1.0 pro text to video. Advanced AI video generation with smooth motion and detail. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location --request POST 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-pro-250528/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "prompt": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": false, "resolution": "480p", "generate_audio": true, "seed": -1 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-pro-250528/text-to-video" headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" } payload = { "prompt": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": False, "resolution": "480p", "generate_audio": True, "seed": -1 } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` ```javascript JavaScript theme={null} const axios = require('axios'); const url = 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-pro-250528/text-to-video'; const headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }; const data = { prompt: 'Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.', duration: 5, aspect_ratio: '1:1', camera_fixed: false, resolution: '480p', generate_audio: true, seed: -1 }; axios.post(url, data, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-pro-250528/text-to-video" payload := map[string]interface{}{ "prompt": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": false, "resolution": "480p", "generate_audio": true, "seed": -1, } jsonData, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Println(err) return } defer resp.Body.Close() var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) fmt.Println(result) } ``` ## Response Example ```json theme={null} { "data": { "id": "cgt-20251225201409-abc", "model": "doubao-seedance-1-0-pro-250528", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/cgt-20251225201409-abc/result" }, "hasNsfwContents": [], "status": "created", "createdAt": "2025-12-25 20:14:09", "executionTime": 0, "timings": { "inference": 0 } }, "message": "success", "code": 200 } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ### How to obtain the id After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id Use this id (or the complete URL) to poll the endpoint shown above and retrieve the final result. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedance-1-0-Pro-250528 - Image To Video Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-1-0-pro-250528/official-format/image-to-video POST /api/v3/contents/generations/tasks Professional image to video with doubao seedance 1.0 pro. Transform photos into dynamic video content with fluid AI-driven animation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location --request POST 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "doubao-seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl'\''s hair is blown by the wind. Wind sounds can be heard." }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], "resolution": "720p", "ratio": "16:9", "duration": 12 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" } payload = { "model": "doubao-seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard." }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], "resolution": "720p", "ratio": "16:9", "duration": 12 } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` ```javascript JavaScript theme={null} const axios = require('axios'); const url = 'https://gptproto.com/api/v3/contents/generations/tasks'; const headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }; const data = { model: 'doubao-seedance-1-0-pro-250528', content: [ { type: 'text', text: "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard." }, { type: 'image_url', image_url: { url: 'https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png' } } ], resolution: '720p', ratio: '16:9', duration: 12 }; axios.post(url, data, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" payload := map[string]interface{}{ "model": "doubao-seedance-1-0-pro-250528", "content": []map[string]interface{}{ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard.", }, { "type": "image_url", "image_url": map[string]string{ "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", }, }, }, "resolution": "720p", "ratio": "16:9", "duration": 12, } jsonData, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Response Example ```json theme={null} { "id": "cgt-20251225201056-abc" } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` (rs) | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` (rt) | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` (dur) | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` (frames) | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` (fps) | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` (seed) | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` (cf) | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` (wm) | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Model Field Compatibility *** **resolution (rs):** Video resolution > Seedance 1.5 pro, Seedance 1.0 lite default value: `720p` > Seedance 1.0 pro\&pro-fast default value: `1080p` Enumeration values: * 480p * 720p * 1080p: Not supported in reference image scenario; temporarily not supported by Seedance 1.5 pro *** **ratio (rt):** Aspect ratio of the generated video. See [Aspect Ratio & Resolution](#aspect-ratio--resolution) for pixel values corresponding to different aspect ratios. > Default for Text-to-Video is generally `16:9` > Default for Image-to-Video is generally `adaptive`. Note: Default for Reference Image Video Generation is `16:9` > Seedance 1.5 pro default is `adaptive` Enumeration values: * 16:9 * 4:3 * 1:1 * 3:4 * 9:16 * 21:9 * adaptive: Automatically selects the most appropriate aspect ratio based on the ratio of the uploaded first frame image. *** **duration (dur) or frames (frames):** > Seedance 1.5 pro does not support `frames` temporarily > Choose either duration or frames; frames has higher priority than duration. If you want to generate videos with fractional seconds, it is recommended to specify frames. *** #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` | Scenario | `content.role` | Supported Models | Description | | ----------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | Text-to-Video | Not applicable (text only) | Seedance 1.5 pro
Seedance 1.0 pro
Seedance 1.0 pro fast
Seedance 1.0 lite (doubao-seedance-1-0-lite-t2v) | Generate video from text prompts only. | | Image-to-Video (First Frame) | Optional, or `first_frame` | All image-to-video models | Generate video from a first frame image. Requires 1 image\_url object. | | Image-to-Video (First & Last Frame) | First frame: `first_frame`
Last frame: `last_frame` | Seedance 1.5 pro
Seedance 1.0 pro
Seedance 1.0 lite (doubao-seedance-1-0-lite-i2v) | Generate video from first and last frame images. Requires 2 image\_url objects with both roles specified. | | Image-to-Video (Reference Images) | `reference_image` | Seedance 1.0 lite (doubao-seedance-1-0-lite-i2v) | Generate video from reference images. Requires 1-4 image\_url objects, all with reference\_image role. | For First & Last Frame scenario * You can pass the same image for both first and last frame. * If the aspect ratios of first and last frame images are inconsistent, the system will prioritize the first frame and automatically crop the last frame to match. ### Aspect Ratio & Resolution | Resolution | Aspect Ratio | Width x Height (Seedance 1.0) | Width x Height (Seedance 1.5 pro) | | ---------- | ------------ | ----------------------------- | --------------------------------- | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | - | | 1080p | 4:3 | 1664×1248 | - | | 1080p | 1:1 | 1440×1440 | - | | 1080p | 3:4 | 1248×1664 | - | | 1080p | 9:16 | 1088×1920 | - | | 1080p | 21:9 | 2176×928 | - | ### Text Command Parameters You can append `--[parameters]` after the text prompt to control video output specifications, including aspect ratio, frame rate, resolution, etc. ```json Example with text commands theme={null} { "content": [ { "type": "text", "text": "A kitten yawning at the camera. --rs 720p --rt 16:9 --dur 5 --fps 24 --wm true --seed 11 --cf false" } ] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedance-1-0-Pro-250528 - Text To Video Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-1-0-pro-250528/official-format/text-to-video POST /api/v3/contents/generations/tasks Next-gen text to video with doubao seedance 1.0 pro. High-quality AI video creation with creative control and cinematic production values. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location --request POST 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "doubao-seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought." } ], "resolution": "720p", "ratio": "16:9", "duration": 12 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" } payload = { "model": "doubao-seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought." } ], "resolution": "720p", "ratio": "16:9", "duration": 12 } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks"; const headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" }; const payload = { model: "doubao-seedance-1-0-pro-250528", content: [ { type: "text", text: "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought." } ], resolution: "720p", ratio: "16:9", duration: 12 }; fetch(url, { method: "POST", headers: headers, body: JSON.stringify(payload) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" payload := map[string]interface{}{ "model": "doubao-seedance-1-0-pro-250528", "content": []map[string]string{ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.", }, }, "resolution": "720p", "ratio": "16:9", "duration": 12, } jsonPayload, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload)) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Println("Error:", err) return } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Response Example ```json theme={null} { "id": "cgt-20251225201056-abc" } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` (rs) | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` (rt) | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` (dur) | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` (frames) | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` (fps) | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` (seed) | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` (cf) | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` (wm) | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Model Field Compatibility *** **resolution (rs):** Video resolution > Seedance 1.5 pro, Seedance 1.0 lite default value: `720p` > Seedance 1.0 pro\&pro-fast default value: `1080p` Enumeration values: * 480p * 720p * 1080p: Not supported in reference image scenario; temporarily not supported by Seedance 1.5 pro *** **ratio (rt):** Aspect ratio of the generated video. See [Aspect Ratio & Resolution](#aspect-ratio--resolution) for pixel values corresponding to different aspect ratios. > Default for Text-to-Video is generally `16:9` > Default for Image-to-Video is generally `adaptive`. Note: Default for Reference Image Video Generation is `16:9` > Seedance 1.5 pro default is `adaptive` Enumeration values: * 16:9 * 4:3 * 1:1 * 3:4 * 9:16 * 21:9 * adaptive: Automatically selects the most appropriate aspect ratio based on the ratio of the uploaded first frame image. *** **duration (dur) or frames (frames):** > Seedance 1.5 pro does not support `frames` temporarily > Choose either duration or frames; frames has higher priority than duration. If you want to generate videos with fractional seconds, it is recommended to specify frames. *** #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` | Scenario | `content.role` | Supported Models | Description | | ----------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | Text-to-Video | Not applicable (text only) | Seedance 1.5 pro
Seedance 1.0 pro
Seedance 1.0 pro fast
Seedance 1.0 lite (doubao-seedance-1-0-lite-t2v) | Generate video from text prompts only. | | Image-to-Video (First Frame) | Optional, or `first_frame` | All image-to-video models | Generate video from a first frame image. Requires 1 image\_url object. | | Image-to-Video (First & Last Frame) | First frame: `first_frame`
Last frame: `last_frame` | Seedance 1.5 pro
Seedance 1.0 pro
Seedance 1.0 lite (doubao-seedance-1-0-lite-i2v) | Generate video from first and last frame images. Requires 2 image\_url objects with both roles specified. | | Image-to-Video (Reference Images) | `reference_image` | Seedance 1.0 lite (doubao-seedance-1-0-lite-i2v) | Generate video from reference images. Requires 1-4 image\_url objects, all with reference\_image role. | For First & Last Frame scenario * You can pass the same image for both first and last frame. * If the aspect ratios of first and last frame images are inconsistent, the system will prioritize the first frame and automatically crop the last frame to match. ### Aspect Ratio & Resolution | Resolution | Aspect Ratio | Width x Height (Seedance 1.0) | Width x Height (Seedance 1.5 pro) | | ---------- | ------------ | ----------------------------- | --------------------------------- | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | - | | 1080p | 4:3 | 1664×1248 | - | | 1080p | 1:1 | 1440×1440 | - | | 1080p | 3:4 | 1248×1664 | - | | 1080p | 9:16 | 1088×1920 | - | | 1080p | 21:9 | 2176×928 | - | ### Text Command Parameters You can append `--[parameters]` after the text prompt to control video output specifications, including aspect ratio, frame rate, resolution, etc. ```json Example with text commands theme={null} { "content": [ { "type": "text", "text": "A kitten yawning at the camera. --rs 720p --rt 16:9 --dur 5 --fps 24 --wm true --seed 11 --cf false" } ] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-1-5-pro-251215 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-1-5-pro-251215/gptproto-format/image-to-video POST https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/image-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/image-to-video" payload = json.dumps({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-1-5-pro-251215 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-1-5-pro-251215/gptproto-format/text-to-video POST https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/text-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/text-to-video" payload = json.dumps({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-5-pro-251215/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-1-5-pro-251215 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-1-5-pro-251215/official-format/image-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-1-5-pro-251215 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-1-5-pro-251215/official-format/text-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-260128 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-260128/gptproto-format/image-to-video POST https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/image-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/image-to-video" payload = json.dumps({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-260128 (Reference To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-260128/gptproto-format/reference-to-video POST https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/reference-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/reference-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/reference-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/reference-to-video" payload = json.dumps({ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/reference-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-260128 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-260128/gptproto-format/text-to-video POST https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/text-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/text-to-video" payload = json.dumps({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-260128/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-260128 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-260128/official-format/image-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-260128 (Reference To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-260128/official-format/reference-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-260128 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-260128/official-format/text-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-fast-260128 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-fast-260128/gptproto-format/image-to-video POST https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/image-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/image-to-video" payload = json.dumps({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-fast-260128 (Reference To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-fast-260128/gptproto-format/reference-to-video POST https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/reference-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/reference-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/reference-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/reference-to-video" payload = json.dumps({ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/reference-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-fast-260128 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-fast-260128/gptproto-format/text-to-video POST https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/text-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/text-to-video" payload = json.dumps({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-2-0-fast-260128/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-fast-260128 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-fast-260128/official-format/image-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-fast-260128 (Reference To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-fast-260128/official-format/reference-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # doubao-seedance-2-0-fast-260128 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedance-2-0-fast-260128/official-format/text-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-4-0-250828 - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-4-0-250828/gptproto-format/image-edit POST https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/image-edit Creative doubao seedream 4.0 image edit tools. Precise AI retouching, style transfers, and artistic enhancements for any photograph. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/image-edit" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/image-edit" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-4-0-250828 - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-4-0-250828/gptproto-format/text-to-image POST https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/text-to-image Stunning doubao seedream 4.0 text to image generation. Beautiful, high-resolution AI art and photorealistic imagery from your prompts. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/text-to-image" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedream-4-0-250828/text-to-image" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-4-0-250828 - Image Edit Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-4-0-250828/official-format/image-edit POST https://gptproto.com/api/v3/images/generations Professional image edit with doubao seedream 4.0. Advanced tools for inpainting, outpainting, and realistic photo manipulation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedream-4-0-250828", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedream-4-0-250828", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "doubao-seedream-4-0-250828", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedream-4-0-250828", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-4-0-250828 - Text To Image Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-4-0-250828/official-format/text-to-image POST https://gptproto.com/api/v3/images/generations Innovative text to image with doubao seedream 4.0. Turn imagination into reality with high-detail digital art and photorealistic renders. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedream-4-0-250828", "prompt": "Fisheye lens, a cat'\''s head, the picture shows the cat'\''s facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedream-4-0-250828", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "doubao-seedream-4-0-250828", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedream-4-0-250828", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-4-5-251128 - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-4-5-251128/gptproto-format/image-edit POST https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/image-edit Advanced doubao seedream 4.5 image edit. Smart object manipulation and high-fidelity retouching for professional designers and creators. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/image-edit" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/image-edit" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-4-5-251128 - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-4-5-251128/gptproto-format/text-to-image POST https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/text-to-image Next-level doubao seedream 4.5 text to image. Create intricate, high-definition visuals with superior prompt adherence and aesthetics. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/text-to-image" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedream-4-5-251128/text-to-image" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-4-5-251128 - Image Edit Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-4-5-251128/official-format/image-edit POST https://gptproto.com/api/v3/images/generations High-end image edit via doubao seedream 4.5. Powerful AI tools for creative photo editing and professional-grade visual adjustments. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedream-4-5-251128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedream-4-5-251128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "doubao-seedream-4-5-251128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedream-4-5-251128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-4-5-251128 - Text To Image Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-4-5-251128/official-format/text-to-image POST https://gptproto.com/api/v3/images/generations Creative text to image with doubao seedream 4.5. Generate breathtaking AI art with consistent styles and stunning high-resolution detail. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedream-4-5-251128", "prompt": "Fisheye lens, a cat'\''s head, the picture shows the cat'\''s facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedream-4-5-251128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "doubao-seedream-4-5-251128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedream-4-5-251128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-5-0-260128 - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-5-0-260128/gptproto-format/image-edit POST https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/image-edit State-of-the-art doubao seedream 5.0 image edit. The ultimate AI toolkit for flawless photo manipulation and creative visual effects. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/image-edit" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/image-edit" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-5-0-260128 - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-5-0-260128/gptproto-format/text-to-image POST https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/text-to-image Elite doubao seedream 5.0 text to image generation. Breathtakingly realistic and artistic visuals created from your simple descriptions. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/text-to-image" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedream-5-0-260128/text-to-image" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-5-0-260128 - Image Edit Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-5-0-260128/official-format/image-edit POST https://gptproto.com/api/v3/images/generations Professional-grade image edit with doubao seedream 5.0. Experience the pinnacle of AI image retouching and creative transformation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedream-5-0-260128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedream-5-0-260128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "doubao-seedream-5-0-260128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedream-5-0-260128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Doubao-Seedream-5-0-260128 - Text To Image Source: https://docs.gptproto.com/docs/allapi/Doubao/doubao-seedream-5-0-260128/official-format/text-to-image POST https://gptproto.com/api/v3/images/generations Superior text to image by doubao seedream 5.0. Industry-leading quality for photorealistic renders and high-concept digital illustrations. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "doubao-seedream-5-0-260128", "prompt": "Fisheye lens, a cat'\''s head, the picture shows the cat'\''s facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "doubao-seedream-5-0-260128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "doubao-seedream-5-0-260128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "doubao-seedream-5-0-260128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-260128 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-260128/gptproto-format/image-to-video POST https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/image-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/image-to-video" payload = json.dumps({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-260128 (Reference To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-260128/gptproto-format/reference-to-video POST https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/reference-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/reference-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/reference-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/reference-to-video" payload = json.dumps({ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/reference-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-260128 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-260128/gptproto-format/text-to-video POST https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/text-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/text-to-video" payload = json.dumps({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-260128/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-260128 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-260128/official-format/image-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-260128 (Reference To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-260128/official-format/reference-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-260128 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-260128/official-format/text-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "dreamina-seedance-2-0-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-fast-260128 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-fast-260128/gptproto-format/image-to-video POST https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/image-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/image-to-video" payload = json.dumps({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-fast-260128 (Reference To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-fast-260128/gptproto-format/reference-to-video POST https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/reference-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/reference-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/reference-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/reference-to-video" payload = json.dumps({ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/reference-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A cat walking on the beach, waves gently lapping at its paws, warm sunset lighting, cinematic slow motion", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-fast-260128 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-fast-260128/gptproto-format/text-to-video POST https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/text-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/text-to-video" payload = json.dumps({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/dreamina-seedance-2-0-fast-260128/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-fast-260128 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-fast-260128/official-format/image-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-fast-260128 (Reference To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-fast-260128/official-format/reference-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # dreamina-seedance-2-0-fast-260128 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/dreamina-seedance-2-0-fast-260128/official-format/text-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "dreamina-seedance-2-0-fast-260128", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedance-1-0-Lite-I2v-250428 - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-lite-i2v-250428/gptproto-format/image-to-video POST /api/v3/bytedance/doubao-seedance-1-0-lite-i2v-250428/image-to-video Fast seedance 1.0 lite image to video. Quickly turn photos into engaging animations and short clips with efficient AI processing. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location --request POST 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-lite-i2v-250428/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl'\''s hair is blown by the wind. Wind sounds can be heard.", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", "last_image": "", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": false, "resolution": "480p", "generate_audio": true, "seed": -1 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-lite-i2v-250428/image-to-video" headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" } payload = { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard.", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", "last_image": "", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": False, "resolution": "480p", "generate_audio": True, "seed": -1 } response = requests.post(url, headers=headers, json=payload) print(response.json()) ``` ```javascript JavaScript theme={null} const axios = require('axios'); const url = 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-lite-i2v-250428/image-to-video'; const headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }; const data = { prompt: "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard.", image: "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", last_image: "", duration: 5, aspect_ratio: "1:1", camera_fixed: false, resolution: "480p", generate_audio: true, seed: -1 }; axios.post(url, data, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-lite-i2v-250428/image-to-video" payload := map[string]interface{}{ "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard.", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", "last_image": "", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": false, "resolution": "480p", "generate_audio": true, "seed": -1, } jsonData, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) fmt.Println(result) } ``` ## Response Example ```json theme={null} { "data": { "id": "cgt-20251225201409-abc", "model": "seedance-1-0-lite-i2v-250428", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/cgt-20251225201409-abc/result" }, "hasNsfwContents": [], "status": "created", "createdAt": "2025-12-25 20:14:09", "executionTime": 0, "timings": { "inference": 0 } }, "message": "success", "code": 200 } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ### How to obtain the id After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id Use this id (or the complete URL) to poll the endpoint shown above and retrieve the final result. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedance-1-0-Lite-I2v-250428 - Image To Video Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-lite-i2v-250428/official-format/image-to-video POST /api/v3/contents/generations/tasks Budget-friendly image to video with seedance 1.0 lite. Easy-to-use tool for creating simple AI-generated motion from your images. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location --request POST 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "seedance-1-0-lite-i2v-250428", "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl'\''s hair is blown by the wind. Wind sounds can be heard." }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], "resolution": "720p", "ratio": "16:9", "duration": 12 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" } payload = { "model": "seedance-1-0-lite-i2v-250428", "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard." }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], "resolution": "720p", "ratio": "16:9", "duration": 12 } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` ```javascript JavaScript theme={null} const axios = require('axios'); const url = 'https://gptproto.com/api/v3/contents/generations/tasks'; const headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }; const data = { model: 'seedance-1-0-lite-i2v-250428', content: [ { type: 'text', text: "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard." }, { type: 'image_url', image_url: { url: 'https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png' } } ], resolution: '720p', ratio: '16:9', duration: 12 }; axios.post(url, data, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" payload := map[string]interface{}{ "model": "seedance-1-0-lite-i2v-250428", "content": []map[string]interface{}{ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard.", }, { "type": "image_url", "image_url": map[string]string{ "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png", }, }, }, "resolution": "720p", "ratio": "16:9", "duration": 12, } jsonData, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Println(err) return } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Response Example ```json theme={null} { "id": "cgt-20251225201056-abc" } ``` ## Query Result ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` ## Parameters ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` (rs) | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` (rt) | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` (dur) | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` (frames) | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` (fps) | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` (seed) | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` (cf) | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` (wm) | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Model Field Compatibility *** **resolution (rs):** Video resolution > Seedance 1.5 pro, Seedance 1.0 lite default value: `720p` > Seedance 1.0 pro\&pro-fast default value: `1080p` Enumeration values: * 480p * 720p * 1080p: Not supported in reference image scenario; temporarily not supported by Seedance 1.5 pro *** **ratio (rt):** Aspect ratio of the generated video. See [Aspect Ratio & Resolution](#aspect-ratio--resolution) for pixel values corresponding to different aspect ratios. > Default for Text-to-Video is generally `16:9` > Default for Image-to-Video is generally `adaptive`. Note: Default for Reference Image Video Generation is `16:9` > Seedance 1.5 pro default is `adaptive` Enumeration values: * 16:9 * 4:3 * 1:1 * 3:4 * 9:16 * 21:9 * adaptive: Automatically selects the most appropriate aspect ratio based on the ratio of the uploaded first frame image. *** **duration (dur) or frames (frames):** > Seedance 1.5 pro does not support `frames` temporarily > Choose either duration or frames; frames has higher priority than duration. If you want to generate videos with fractional seconds, it is recommended to specify frames. *** #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` | Scenario | `content.role` | Supported Models | Description | | ----------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | Text-to-Video | Not applicable (text only) | Seedance 1.5 pro
Seedance 1.0 pro
Seedance 1.0 pro fast
Seedance 1.0 lite (doubao-seedance-1-0-lite-t2v) | Generate video from text prompts only. | | Image-to-Video (First Frame) | Optional, or `first_frame` | All image-to-video models | Generate video from a first frame image. Requires 1 image\_url object. | | Image-to-Video (First & Last Frame) | First frame: `first_frame`
Last frame: `last_frame` | Seedance 1.5 pro
Seedance 1.0 pro
Seedance 1.0 lite (doubao-seedance-1-0-lite-i2v) | Generate video from first and last frame images. Requires 2 image\_url objects with both roles specified. | | Image-to-Video (Reference Images) | `reference_image` | Seedance 1.0 lite (doubao-seedance-1-0-lite-i2v) | Generate video from reference images. Requires 1-4 image\_url objects, all with reference\_image role. | For First & Last Frame scenario * You can pass the same image for both first and last frame. * If the aspect ratios of first and last frame images are inconsistent, the system will prioritize the first frame and automatically crop the last frame to match. ### Aspect Ratio & Resolution | Resolution | Aspect Ratio | Width x Height (Seedance 1.0) | Width x Height (Seedance 1.5 pro) | | ---------- | ------------ | ----------------------------- | --------------------------------- | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | - | | 1080p | 4:3 | 1664×1248 | - | | 1080p | 1:1 | 1440×1440 | - | | 1080p | 3:4 | 1248×1664 | - | | 1080p | 9:16 | 1088×1920 | - | | 1080p | 21:9 | 2176×928 | - | ### Text Command Parameters You can append `--[parameters]` after the text prompt to control video output specifications, including aspect ratio, frame rate, resolution, etc. ```json Example with text commands theme={null} { "content": [ { "type": "text", "text": "A kitten yawning at the camera. --rs 720p --rt 16:9 --dur 5 --fps 24 --wm true --seed 11 --cf false" } ] } ``` ## Error Codes ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedance-1-0-Lite-T2v-250428 - Text To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-lite-t2v-250428/gptproto-format/text-to-video POST /api/v3/bytedance/doubao-seedance-1-0-lite-t2v-250428/text-to-video Quick seedance 1.0 lite text to video. Generate fun and engaging video clips from text prompts with high efficiency and speed. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location --request POST 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-lite-t2v-250428/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "prompt": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": false, "resolution": "480p", "generate_audio": true, "seed": -1 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-lite-t2v-250428/text-to-video" headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" } payload = { "prompt": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": False, "resolution": "480p", "generate_audio": True, "seed": -1 } response = requests.post(url, headers=headers, json=payload) print(response.json()) ``` ```javascript JavaScript theme={null} const axios = require('axios'); const url = 'https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-lite-t2v-250428/text-to-video'; const headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }; const data = { prompt: "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.", duration: 5, aspect_ratio: "1:1", camera_fixed: false, resolution: "480p", generate_audio: true, seed: -1 }; axios.post(url, data, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/bytedance/doubao-seedance-1-0-lite-t2v-250428/text-to-video" payload := map[string]interface{}{ "prompt": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.", "duration": 5, "aspect_ratio": "1:1", "camera_fixed": false, "resolution": "480p", "generate_audio": true, "seed": -1, } jsonData, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Response Example ```json theme={null} { "data": { "id": "cgt-20251225201409-abc", "model": "seedance-1-0-lite-t2v-250428", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/cgt-20251225201409-abc/result" }, "hasNsfwContents": [], "status": "created", "createdAt": "2025-12-25 20:14:09", "executionTime": 0, "timings": { "inference": 0 } }, "message": "success", "code": 200 } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ### How to obtain the id After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id Use this id (or the complete URL) to poll the endpoint shown above and retrieve the final result. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedance-1-0-Lite-T2v-250428 - Text To Video Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-lite-t2v-250428/official-format/text-to-video POST /api/v3/contents/generations/tasks Simple text to video via seedance 1.0 lite. Efficient AI video generation for social media and fast content prototyping. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location --request POST 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "seedance-1-0-lite-t2v-250428", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought." } ], "resolution": "720p", "ratio": "16:9", "duration": 12 }' ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" } payload = { "model": "seedance-1-0-lite-t2v-250428", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought." } ], "resolution": "720p", "ratio": "16:9", "duration": 12 } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks"; const headers = { "Authorization": "GPTPROTO_API_KEY", "Content-Type": "application/json" }; const payload = { model: "seedance-1-0-lite-t2v-250428", content: [ { type: "text", text: "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought." } ], resolution: "720p", ratio: "16:9", duration: 12 }; fetch(url, { method: "POST", headers: headers, body: JSON.stringify(payload) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" payload := map[string]interface{}{ "model": "seedance-1-0-lite-t2v-250428", "content": []map[string]string{ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought.", }, }, "resolution": "720p", "ratio": "16:9", "duration": 12, } jsonPayload, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload)) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Println("Error:", err) return } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ## Response Example ```json theme={null} { "id": "cgt-20251225201056-abc" } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` (rs) | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` (rt) | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` (dur) | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` (frames) | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` (fps) | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` (seed) | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` (cf) | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` (wm) | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Model Field Compatibility *** **resolution (rs):** Video resolution > Seedance 1.5 pro, Seedance 1.0 lite default value: `720p` > Seedance 1.0 pro\&pro-fast default value: `1080p` Enumeration values: * 480p * 720p * 1080p: Not supported in reference image scenario; temporarily not supported by Seedance 1.5 pro *** **ratio (rt):** Aspect ratio of the generated video. See [Aspect Ratio & Resolution](#aspect-ratio--resolution) for pixel values corresponding to different aspect ratios. > Default for Text-to-Video is generally `16:9` > Default for Image-to-Video is generally `adaptive`. Note: Default for Reference Image Video Generation is `16:9` > Seedance 1.5 pro default is `adaptive` Enumeration values: * 16:9 * 4:3 * 1:1 * 3:4 * 9:16 * 21:9 * adaptive: Automatically selects the most appropriate aspect ratio based on the ratio of the uploaded first frame image. *** **duration (dur) or frames (frames):** > Seedance 1.5 pro does not support `frames` temporarily > Choose either duration or frames; frames has higher priority than duration. If you want to generate videos with fractional seconds, it is recommended to specify frames. *** #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` | Scenario | `content.role` | Supported Models | Description | | ----------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | Text-to-Video | Not applicable (text only) | Seedance 1.5 pro
Seedance 1.0 pro
Seedance 1.0 pro fast
Seedance 1.0 lite (doubao-seedance-1-0-lite-t2v) | Generate video from text prompts only. | | Image-to-Video (First Frame) | Optional, or `first_frame` | All image-to-video models | Generate video from a first frame image. Requires 1 image\_url object. | | Image-to-Video (First & Last Frame) | First frame: `first_frame`
Last frame: `last_frame` | Seedance 1.5 pro
Seedance 1.0 pro
Seedance 1.0 lite (doubao-seedance-1-0-lite-i2v) | Generate video from first and last frame images. Requires 2 image\_url objects with both roles specified. | | Image-to-Video (Reference Images) | `reference_image` | Seedance 1.0 lite (doubao-seedance-1-0-lite-i2v) | Generate video from reference images. Requires 1-4 image\_url objects, all with reference\_image role. | For First & Last Frame scenario * You can pass the same image for both first and last frame. * If the aspect ratios of first and last frame images are inconsistent, the system will prioritize the first frame and automatically crop the last frame to match. ### Aspect Ratio & Resolution | Resolution | Aspect Ratio | Width x Height (Seedance 1.0) | Width x Height (Seedance 1.5 pro) | | ---------- | ------------ | ----------------------------- | --------------------------------- | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | - | | 1080p | 4:3 | 1664×1248 | - | | 1080p | 1:1 | 1440×1440 | - | | 1080p | 3:4 | 1248×1664 | - | | 1080p | 9:16 | 1088×1920 | - | | 1080p | 21:9 | 2176×928 | - | ### Text Command Parameters You can append `--[parameters]` after the text prompt to control video output specifications, including aspect ratio, frame rate, resolution, etc. ```json Example with text commands theme={null} { "content": [ { "type": "text", "text": "A kitten yawning at the camera. --rs 720p --rt 16:9 --dur 5 --fps 24 --wm true --seed 11 --cf false" } ] } ``` ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-0-pro-250528 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-pro-250528/gptproto-format/image-to-video POST https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/image-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/image-to-video" payload = json.dumps({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-0-pro-250528 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-pro-250528/gptproto-format/text-to-video POST https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/text-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/text-to-video" payload = json.dumps({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-250528/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-0-pro-250528 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-pro-250528/official-format/image-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-0-pro-250528 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-pro-250528/official-format/text-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "seedance-1-0-pro-250528", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-0-pro-fast-251015 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-pro-fast-251015/gptproto-format/image-to-video POST https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/image-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/image-to-video" payload = json.dumps({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-0-pro-fast-251015 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-pro-fast-251015/gptproto-format/text-to-video POST https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/text-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/text-to-video" payload = json.dumps({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedance-1-0-pro-fast-251015/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-0-pro-fast-251015 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-pro-fast-251015/official-format/image-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedance-1-0-pro-fast-251015", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedance-1-0-pro-fast-251015", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "seedance-1-0-pro-fast-251015", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "seedance-1-0-pro-fast-251015", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-0-pro-fast-251015 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-0-pro-fast-251015/official-format/text-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedance-1-0-pro-fast-251015", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedance-1-0-pro-fast-251015", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "seedance-1-0-pro-fast-251015", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "seedance-1-0-pro-fast-251015", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-5-pro-251215 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-5-pro-251215/gptproto-format/image-to-video POST https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/image-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/image-to-video" payload = json.dumps({ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field", "image": "https://tos.gptproto.com/resource/cat.png", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-5-pro-251215 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-5-pro-251215/gptproto-format/text-to-video POST https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/text-to-video ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/text-to-video" payload = json.dumps({ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedance-1-5-pro-251215/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens.", "aspect_ratio": "16:9", "duration": 5, "resolution": "720p", "seed": -1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "created", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. |
### Video Generation Scenarios ```json First Frame theme={null} { "prompt": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard", "image": "https://example.com/ref_image_1.png" } ``` ```json First & Last Frame theme={null} { "prompt": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement", "image": "https://example.com/ref_image_1.png", "last_image": "https://example.com/ref_image_2.png" } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `image` | string | ✅ Yes | - | - | The input image URL for video generation. | | `last_image` | string | ❌ No | - | - | The ending frame image URL (optional, for controlling video ending). | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input image is uploaded media (base64/Data URI). |
> **Note:** Reference scenarios are only supported by Seedance 2.0. ### Video Generation Scenarios ```json Image-only theme={null} { "prompt": "A cat walking on the beach at sunset, cinematic lighting", "images": [ "https://example.com/ref_image_1.png", "https://example.com/ref_image_2.png" ] } ``` ```json Image + Video theme={null} { "prompt": "A dog running through a park, following the style and motion of the reference video", "videos": [ "https://example.com/ref_video.mp4" ], "images": [ "https://example.com/ref_image_1.png" ], "audios": [ "https://example.com/ref_audio.mp3" ] } ``` ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | --------------- | -------- | ------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `videos` | array of string | ❌ No | - | - | Array of URLs to reference videos. At least one of `videos` or `images` is required. | | `images` | array of string | ❌ No | - | Max 10 items | Including reference images of the element, scene, style, etc. Maximum 10 images. At least one of `videos` or `images` is required. | | `audios` | array of string | ❌ No | - | - | Reference audio URLs for audio style transfer. | | `aspect_ratio` | string | ❌ No | `16:9` | `21:9`
`16:9`
`4:3`
`1:1`
`3:4`
`9:16` | The aspect ratio of the generated media. | | `duration` | string | ❌ No | `5` | `4 ~ 15` | The duration of the generated media in seconds. | | `resolution` | string | ❌ No | `720p` | `720p`
`480p`
`1080p` | Video resolution. | | `generate_audio` | boolean | ❌ No | `true` | `false`, `true` | Whether to generate audio. | | `camera_fixed` | boolean | ❌ No | `false` | `false`, `true` | Whether to fix the camera position. | | `seed` | integer | ❌ No | `-1` | `-1 ~ 2147483647` | The random seed to use for the generation. `-1` means a random seed will be used. | | `is_upload_media` | boolean | ❌ No | `false` | `false`, `true` | Whether the input media is uploaded (base64/Data URI). |
### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-5-pro-251215 (Image To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-5-pro-251215/official-format/image-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "A girl holding a fox, gentle breeze blowing through her hair, golden sunset light, cinematic, shallow depth of field" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ], "generate_audio": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # seedance-1-5-pro-251215 (Text To Video) Source: https://docs.gptproto.com/docs/allapi/Doubao/seedance-1-5-pro-251215/official-format/text-to-video POST https://gptproto.com/api/v3/contents/generations/tasks ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/contents/generations/tasks' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/contents/generations/tasks', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks" payload = json.dumps({ "model": "seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks" method := "POST" payload := strings.NewReader(`{ "model": "seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room, slow camera pan reveals scattered papers on a mahogany desk. Cut to close-up of a flickering candle, then wide shot of the detective picking up a blood-stained letter. Cinematic lighting, film noir style, 35mm lens." } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/contents/generations/tasks/{id}" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/contents/generations/tasks/{id}"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/contents/generations/tasks/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` ### Response ```json theme={null} { "id": "cgt-20251225195352-123", "model": "doubao-seedance-1-5-pro-251215", "status": "succeeded", "content": { "video_url": "https://example.com/video.mp4" }, "usage": { "completion_tokens": 260100, "total_tokens": 260100 }, "seed": "16108", "resolution": "720p", "duration": 12, "ratio": "16:9", "created_at": "1766663633", "updated_at": "1766663715", "framespersecond": 24 } ``` **Status Enum** | Status | Description | | ----------- | ----------- | | `queued` | Queued | | `running` | Running | | `succeeded` | Succeeded | | `failed` | Failed | | `expired` | Expired | ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | ----------------------------- | ------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | The ID of the model you want to call. You need to enable model service and query the Model ID. You can also call the model through Endpoint ID to get advanced capabilities such as rate limiting, billing type (prepaid/postpaid), running status query, monitoring, and security. | | `content` | array | ✅ Yes | - | - | Information input to the model for video generation, supporting text and image information. | | >`content.type` | string | ✅ Yes | - | `text`
`image_url` | Type of input content. Use `text` for text input, `image_url` for image input (supports image URL or Base64 encoding). | | >`content.text` | string | ✅ Yes (if type is text) | - | - | Text content input to the model, describing the expected video to be generated. | | >`content.image_url` | object | ✅ Yes (if type is image\_url) | - | - | Image object input to the model. | | >>`content.image_url.url` | string | ✅ Yes (if image\_url is used) | - | - | Image information, which can be an image URL or Base64 encoded image. | | >`content.role` | string | ❌ No | - | `first_frame`
`last_frame`
`reference_image` | Position or purpose of the image. Different roles correspond to different video generation scenarios. See [Video Generation Scenarios](#video-generation-scenarios) for details. | | `generate_audio` | boolean | ❌ No | true | - | Whether to include synchronized sound with the video. Only supported by Seedance 1.5 pro. | ### Advanced Parameters > **Note:** Different models may support different parameter options. For more details, please refer to the [Model Field Compatibility](#model-field-compatibility) table. | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------- | | `resolution` | string | ❌ No | 720p/1080p | `480p`
`720p`
`1080p` | Video resolution. Default values vary by model. | | `ratio` | string | ❌ No | 16:9/adaptive | `16:9`
`4:3`
`1:1`
`3:4`
`9:16`
`21:9`
`adaptive` | Aspect ratio of the generated video. | | `duration` | integer | ❌ No | 5 | \[2, 12] | Duration of the generated video in seconds. | | `frames` | integer | ❌ No | - | \[29, 289] (25+4n) | Number of frames of the generated video. | | `framespersecond` | integer | ❌ No | 24 | 24 | Frame rate of the video in frames per second. | | `seed` | integer | ❌ No | -1 | \[-1, 2^32-1] | Seed integer for controlling randomness. | | `camerafixed` | boolean | ❌ No | false | - | Whether to fix the camera. | | `watermark` | boolean | ❌ No | false | - | Whether to include watermark in the generated video. | #### Video Generation Scenarios First frame video generation, first and last frame video generation, and reference image video generation are three mutually exclusive scenarios and cannot be mixed. > **Note:** Reference scenarios are only supported by Seedance 2.0. ```json Text-to-Video theme={null} { "content": [ { "type": "text", "text": "Multiple shots. A detective enters a dimly lit room. He examines the clues on the table and picks up an item. The camera shifts to him deep in thought. --ratio 16:9" } ] } ``` ```json First Frame theme={null} { "content": [ { "type": "text", "text": "A girl holding a fox opens her eyes and looks gently at the camera. The fox is held affectionately. The camera slowly pulls back as the girl's hair is blown by the wind. Wind sounds can be heard. --ratio adaptive --dur 5" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png" } } ], } ``` ```json First & Last Frame theme={null} { "model": "doubao-seedance-1-5-pro-251215", "content": [ { "type": "text", "text": "The girl in the picture says 'cheese' to the camera with 360-degree surrounding camera movement" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg" }, "role": "first_frame" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg" }, "role": "last_frame" } ], "generate_audio": true } ``` ```json Reference Images theme={null} { "content": [ { "type": "text", "text": "[Image 1] A boy wearing glasses and a blue T-shirt with [Image 2] a corgi puppy, sitting on [Image 3] a lawn, in 3D cartoon style" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png" }, "role": "reference_image" }, { "type": "image_url", "image_url": { "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png" }, "role": "reference_image" } ] } ``` ### Aspect Ratio & Resolution > **Note:** 1080p is not supported in reference image scene for Seedance 1.0 lite. 1080p is not supported for Seedance 2.0 fast. | Resolution | Aspect Ratio | Width x Height
Seedance 1.0 | Width x Height
Seedance 1.5 pro
Seedance 2.0 & 2.0 fast | | ---------- | ------------ | --------------------------------- | ------------------------------------------------------------------ | | 480p | 16:9 | 864×480 | 864×496 | | 480p | 4:3 | 736×544 | 752×560 | | 480p | 1:1 | 640×640 | 640×640 | | 480p | 3:4 | 544×736 | 560×752 | | 480p | 9:16 | 480×864 | 496×864 | | 480p | 21:9 | 960×416 | 992×432 | | 720p | 16:9 | 1248×704 | 1280×720 | | 720p | 4:3 | 1120×832 | 1112×834 | | 720p | 1:1 | 960×960 | 960×960 | | 720p | 3:4 | 832×1120 | 834×1112 | | 720p | 9:16 | 704×1248 | 720×1280 | | 720p | 21:9 | 1504×640 | 1470×630 | | 1080p | 16:9 | 1920×1088 | 1920×1088 | | 1080p | 4:3 | 1664×1248 | 1664×1248 | | 1080p | 1:1 | 1440×1440 | 1440×1440 | | 1080p | 3:4 | 1248×1664 | 1248×1664 | | 1080p | 9:16 | 1088×1920 | 1088×1920 | | 1080p | 21:9 | 2176×928 | 2176×928 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-4-0-250828 - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-4-0-250828/gptproto-format/image-edit POST https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/image-edit Creative seedream 4.0 image edit tools. Simple yet powerful AI features for photo retouching, styling, and seamless visual edits. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/image-edit" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/image-edit" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-4-0-250828 - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-4-0-250828/gptproto-format/text-to-image POST https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/text-to-image Beautiful seedream 4.0 text to image generation. High-quality AI art and realistic photography from your unique creative prompts. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/text-to-image" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedream-4-0-250828/text-to-image" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-4-0-250828 - Image Edit Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-4-0-250828/official-format/image-edit POST https://gptproto.com/api/v3/images/generations Effective image edit with seedream 4.0. Versatile AI tools for enhancing photos and creating stunning visual compositions easily. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedream-4-0-250828", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedream-4-0-250828", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "seedream-4-0-250828", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "seedream-4-0-250828", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-4-0-250828 - Text To Image Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-4-0-250828/official-format/text-to-image POST https://gptproto.com/api/v3/images/generations Stunning text to image by seedream 4.0. Generate high-resolution visuals and artistic illustrations with remarkable AI precision. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedream-4-0-250828", "prompt": "Fisheye lens, a cat'\''s head, the picture shows the cat'\''s facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedream-4-0-250828", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "seedream-4-0-250828", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "seedream-4-0-250828", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-4-5-251128 - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-4-5-251128/gptproto-format/image-edit POST https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/image-edit Advanced seedream 4.5 image edit features. Professional-level control over object manipulation, style, and high-fidelity retouching. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/image-edit" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/image-edit" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-4-5-251128 - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-4-5-251128/gptproto-format/text-to-image POST https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/text-to-image Elite seedream 4.5 text to image. Create high-definition, stylistically consistent visuals for marketing and creative projects. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/text-to-image" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedream-4-5-251128/text-to-image" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-4-5-251128 - Image Edit Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-4-5-251128/official-format/image-edit POST https://gptproto.com/api/v3/images/generations Pro-grade image edit with seedream 4.5. Master your visual content with sophisticated AI-driven tools for perfect photo results. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedream-4-5-251128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedream-4-5-251128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "seedream-4-5-251128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "seedream-4-5-251128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-4-5-251128 - Text To Image Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-4-5-251128/official-format/text-to-image POST https://gptproto.com/api/v3/images/generations Superior text to image via seedream 4.5. Detailed, high-resolution AI generation that perfectly follows your descriptive text. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedream-4-5-251128", "prompt": "Fisheye lens, a cat'\''s head, the picture shows the cat'\''s facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedream-4-5-251128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "seedream-4-5-251128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "seedream-4-5-251128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-5-0-260128 - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-5-0-260128/gptproto-format/image-edit POST https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/image-edit Premium seedream 5.0 image edit solutions. The most advanced AI toolkit for flawless image manipulation and artistic photo editing. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/image-edit" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/image-edit" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "images": [ "https://d1q70pf5vjeyhc.cloudfront.net/media/92d2d4ca66f84793adcb20742b15d262/images/1757414555847323990_Si8cqCBF.jpeg" ], "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-5-0-260128 - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-5-0-260128/gptproto-format/text-to-image POST https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/text-to-image Next-level seedream 5.0 text to image. Generate breathtakingly realistic and creative visuals with the highest fidelity available. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character'\''s image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/text-to-image" payload = json.dumps({ "enable_base64_output": False, "enable_sync_mode": False, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/bytedance/seedream-5-0-260128/text-to-image" method := "POST" payload := strings.NewReader(`{ "enable_base64_output": false, "enable_sync_mode": false, "prompt": "Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.", "size": "2227*3183" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `enable_base64_output` | boolean | ❌ No | `false` | Whether to output the result as base64 encoded string | | `enable_sync_mode` | boolean | ❌ No | `false` | Whether to enable synchronous mode (wait for result) | | `prompt` | string | ✅ Yes | `Turn this photo into a characterfigure. Behind it, place a box withthe character's image printed on it,and a computer showing the Blendermodeling process on its screen. In frontof the box, add a round plastic basewith the character figure standing on it .set the scene indoors if possible.` | Image generation prompt describing the desired image content | | `size` | string | ❌ No | `2227*3183` | Output image resolution (format: width\*height) | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-5-0-260128 - Image Edit Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-5-0-260128/official-format/image-edit POST https://gptproto.com/api/v3/images/generations Master image edit with seedream 5.0. Professional AI tools for seamless retouching and complex visual transformations. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedream-5-0-260128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedream-5-0-260128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "seedream-5-0-260128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "seedream-5-0-260128", "prompt": "Change bubbles into heart shape", "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg", "response_format": "url", "size": "2k", "seed": 21, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Seedream-5-0-260128 - Text To Image Source: https://docs.gptproto.com/docs/allapi/Doubao/seedream-5-0-260128/official-format/text-to-image POST https://gptproto.com/api/v3/images/generations State-of-the-art text to image by seedream 5.0. Breathtaking high-res AI art and photorealism for discerning creators and designers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "seedream-5-0-260128", "prompt": "Fisheye lens, a cat'\''s head, the picture shows the cat'\''s facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "seedream-5-0-260128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/images/generations" payload = json.dumps({ "model": "seedream-5-0-260128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "seedream-5-0-260128", "prompt": "Fisheye lens, a cat's head, the picture shows the cat's facial features are distorted due to the shooting method.", "response_format": "url", "size": "2k", "seed": 12, "watermark": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ---------------------------- | -------- | ------------------------------------------------------------------ | | `model` | string | ✅ Yes | `doubao-seedream-4-5-251128` | - | The model identifier for image generation/editing | | `prompt` | string | ✅ Yes | - | - | Description of the desired image transformation or generation | | `response_format` | string | ❌ No | `url` | - | Response format: "url" (image URL) or "b64\_json" (base64 encoded) | | `size` | string | ❌ No | `adaptive` | - | Output image resolution. Options: adaptive, 1024x1024, 2K, 4K | | `seed` | integer | ❌ No | - | - | Random seed for reproducible results | | `guidance_scale` | number | ❌ No | `5.5` | 1.0-10.0 | Controls adherence to the prompt. Recommended: 3.0-7.0 | | `watermark` | boolean | ❌ No | `true` | - | Whether to add watermark to the generated image | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image-Hd - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image-hd/gptproto-format/image-edit POST https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/image-edit HD gemini 2.5 flash image edit. Quick, high-definition photo retouching and creative adjustments with professional AI speed. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/image-edit" payload = json.dumps({ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": False, "enable_sync_mode": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/image-edit" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | | ---------------- | ----------------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image` | | `image-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit` | ### Core Body Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. | | `image` | array | ❌ No | - | - | Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 14 images. | ### Advanced Body Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `size` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`4:5`
`5:4`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | The aspect ratio of the generated image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `top_p` | number | ❌ No | - | - | Controls the diversity of the output. | | `enable_sync_mode` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable synchronous mode for image generation. | | `enable_base64_output` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable base64 output for image generation. | | `output_format` | string | ❌ No | `png` | `png`
`jpg`
`jpeg` | The format in which the generated images are returned. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image-Hd - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image-hd/gptproto-format/text-to-image POST https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/text-to-image Stunning gemini 2.5 flash image hd text to image. Rapidly generate high-detail, high-definition visuals from any text prompt. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/text-to-image" payload = json.dumps({ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": False, "enable_sync_mode": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/gemini-2.5-flash-image-hd/text-to-image" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | | ---------------- | ----------------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image` | | `image-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit` | ### Core Body Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. | | `image` | array | ❌ No | - | - | Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 14 images. | ### Advanced Body Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `size` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`4:5`
`5:4`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | The aspect ratio of the generated image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `top_p` | number | ❌ No | - | - | Controls the diversity of the output. | | `enable_sync_mode` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable synchronous mode for image generation. | | `enable_base64_output` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable base64 output for image generation. | | `output_format` | string | ❌ No | `png` | `png`
`jpg`
`jpeg` | The format in which the generated images are returned. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image-Hd - Image Edit Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image-hd/official-format/image-edit POST https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent Crystal clear gemini 2.5 flash image edit hd. High-speed AI tools for precision photo manipulation and high-quality artistic edits. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64_encode_data" } } ], "role": "model" }, "finishReason": "STOP", "index": 0 } ], "usageMetadata": { "promptTokenCount": 7, "candidatesTokenCount": 1202, "totalTokenCount": 1347, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 7 } ], "candidatesTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1120 } ], "thoughtsTokenCount": 138 }, "modelVersion": "gemini-3-pro-image-preview", "responseId": "rUhKaeiQJceM-sAP5p7bsAo" } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------------------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | The prompt for generating images. To include images or multiple images, refer to [Multimodal Input](#multimodal-input). | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.responseModalities` | array | ❌ No | - | `TEXT`
`IMAGE` | The modalities of the response. If set for models that don't support these configuration options, the system will return an error. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "a cat" } ] } ] } ``` ```json inlineData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-1-data" } }, { "inlineData": { "mimeType": "image/png", "data": "base64-encoded-image-2-data" } }, { "text": "Combine these two images into a seamless panorama with a mountain background." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "a cat" } ] } ] } ``` ```json fileData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image1.jpg" } }, { "fileData": { "mimeType": "image/png", "fileUri": "https://example.com/image2.png" } }, { "text": "Remove the background from both images and blend them together with a sunset overlay." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1K" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | >`imageConfig.imageSize` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image-Hd - Text To Image Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image-hd/official-format/text-to-image POST https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent Vibrant text to image with gemini 2.5 flash image hd. Fast, high-resolution AI art generation for any creative or professional use. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64_encode_data" } } ], "role": "model" }, "finishReason": "STOP", "index": 0 } ], "usageMetadata": { "promptTokenCount": 7, "candidatesTokenCount": 1202, "totalTokenCount": 1347, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 7 } ], "candidatesTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1120 } ], "thoughtsTokenCount": 138 }, "modelVersion": "gemini-3-pro-image-preview", "responseId": "rUhKaeiQJceM-sAP5p7bsAo" } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------------------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | The prompt for generating images. To include images or multiple images, refer to [Multimodal Input](#multimodal-input). | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.responseModalities` | array | ❌ No | - | `TEXT`
`IMAGE` | The modalities of the response. If set for models that don't support these configuration options, the system will return an error. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "a cat" } ] } ] } ``` ```json inlineData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-1-data" } }, { "inlineData": { "mimeType": "image/png", "data": "base64-encoded-image-2-data" } }, { "text": "Combine these two images into a seamless panorama with a mountain background." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "a cat" } ] } ] } ``` ```json fileData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image1.jpg" } }, { "fileData": { "mimeType": "image/png", "fileUri": "https://example.com/image2.png" } }, { "text": "Remove the background from both images and blend them together with a sunset overlay." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1K" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | >`imageConfig.imageSize` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image-Hd - Image Edit - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image-hd/openai-format/image-edit POST https://gptproto.com/v1/images/edits Pro-level gemini 2.5 flash image edit hd. Fast and reliable high-definition photo editing and AI-powered visual enhancements. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/edits' \ --header 'Authorization: GPTPROTO_API_KEY' \ --form 'model="gemini-2.5-flash-image-hd"' \ --form 'image[]=@"/path/to/file"' \ --form 'prompt="Put a hat on the cat"' ``` ```javascript JavaScript theme={null} const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('model', 'gemini-2.5-flash-image-hd'); data.append('image[]', fs.createReadStream('/path/to/file')); data.append('prompt', 'Put a hat on the cat'); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/edits', headers: { 'Authorization': 'GPTPROTO_API_KEY', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import http.client import mimetypes from codecs import encode conn = http.client.HTTPSConnection("gptproto.com") dataList = [] boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T' dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=model;')) dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode('')) dataList.append(encode("gemini-2.5-flash-image-hd")) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=image[]; filename={0}'.format('file'))) fileType = mimetypes.guess_type('/path/to/file')[0] or 'application/octet-stream' dataList.append(encode('Content-Type: {}'.format(fileType))) dataList.append(encode('')) with open('/path/to/file', 'rb') as f: dataList.append(f.read()) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=prompt;')) dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode('')) dataList.append(encode("Put a hat on the cat")) dataList.append(encode('--'+boundary+'--')) dataList.append(encode('')) body = b'\r\n'.join(dataList) payload = body headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-type': 'multipart/form-data; boundary={}'.format(boundary) } conn.request("POST", "/v1/images/edits", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```go Go theme={null} package main import ( "fmt" "bytes" "mime/multipart" "os" "path/filepath" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/edits" method := "POST" payload := &bytes.Buffer{} writer := multipart.NewWriter(payload) _ = writer.WriteField("model", "gemini-2.5-flash-image-hd") file, errFile2 := os.Open("/path/to/file") defer file.Close() part2, errFile2 := writer.CreateFormFile("image[]",filepath.Base("/path/to/file")) _, errFile2 = io.Copy(part2, file) if errFile2 != nil { fmt.Println(errFile2) return } _ = writer.WriteField("prompt", "Put a hat on the cat") err := writer.Close() if err != nil { fmt.Println(err) return } client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", writer.FormDataContentType()) res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "created": 1768469705199, "data": [ { "b64_json": "BASE64_ENCODED_IMAGE_DATA" } ], "output_format": "jpeg", "quality": "high", "size": "16:9", "usage": { "input_tokens": 3, "input_tokens_details": { "image_tokens": 0, "text_tokens": 3 }, "output_tokens": 1204, "total_tokens": 1330 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | -------------- | -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `gemini-3-pro-image-preview` | - | The model to use for image editing. Defaults to gemini-3-pro-image-preview. | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). | | `image` | string or file | ❌ No | - | - | You can provide up to 14 images. | | `size` | string | ❌ No | `auto` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Equivalent to the `aspect_ratio` field in Google's official format, used to control the aspect ratio of the output image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | ### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. ### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image-Hd - Text To Image - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image-hd/openai-format/text-to-image POST https://gptproto.com/v1/images/generations Elite gemini 2.5 flash image hd text to image. Experience rapid generation of stunning, high-definition AI imagery and digital art. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash-image-hd", "prompt": "a cat", "size": "16:9" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash-image-hd", "prompt": "a cat", "size": "16:9" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/images/generations" payload = json.dumps({ "model": "gemini-2.5-flash-image-hd", "prompt": "a cat", "size": "16:9" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash-image-hd", "prompt": "a cat", "size": "16:9" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "created": 1768469705199, "data": [ { "b64_json": "BASE64_ENCODED_IMAGE_DATA" } ], "output_format": "jpeg", "quality": "high", "size": "16:9", "usage": { "input_tokens": 3, "input_tokens_details": { "image_tokens": 0, "text_tokens": 3 }, "output_tokens": 1204, "total_tokens": 1330 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | -------------- | -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `gemini-3-pro-image-preview` | - | The model to use for image editing. Defaults to gemini-3-pro-image-preview. | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). | | `image` | string or file | ❌ No | - | - | You can provide up to 14 images. | | `size` | string | ❌ No | `auto` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Equivalent to the `aspect_ratio` field in Google's official format, used to control the aspect ratio of the output image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | ### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. ### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image/gptproto-format/image-edit POST https://gptproto.com/api/v3/google/gemini-2.5-flash-image/image-edit Fast gemini 2.5 flash image edit. Lightweight and efficient AI photo editing for quick style changes and object manipulation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/gemini-2.5-flash-image/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/gemini-2.5-flash-image/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/gemini-2.5-flash-image/image-edit" payload = json.dumps({ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": False, "enable_sync_mode": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/gemini-2.5-flash-image/image-edit" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | | ---------------- | ----------------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image` | | `image-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit` | ### Core Body Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. | | `image` | array | ❌ No | - | - | Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 14 images. | ### Advanced Body Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `size` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`4:5`
`5:4`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | The aspect ratio of the generated image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `top_p` | number | ❌ No | - | - | Controls the diversity of the output. | | `enable_sync_mode` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable synchronous mode for image generation. | | `enable_base64_output` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable base64 output for image generation. | | `output_format` | string | ❌ No | `png` | `png`
`jpg`
`jpeg` | The format in which the generated images are returned. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image/gptproto-format/text-to-image POST https://gptproto.com/api/v3/google/gemini-2.5-flash-image/text-to-image Quick text to image with gemini 2.5 flash image. Generate beautiful AI visuals and illustrations in seconds from simple prompts. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/gemini-2.5-flash-image/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/gemini-2.5-flash-image/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/gemini-2.5-flash-image/text-to-image" payload = json.dumps({ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": False, "enable_sync_mode": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/gemini-2.5-flash-image/text-to-image" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | | ---------------- | ----------------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image` | | `image-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit` | ### Core Body Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. | | `image` | array | ❌ No | - | - | Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 14 images. | ### Advanced Body Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `size` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`4:5`
`5:4`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | The aspect ratio of the generated image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `top_p` | number | ❌ No | - | - | Controls the diversity of the output. | | `enable_sync_mode` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable synchronous mode for image generation. | | `enable_base64_output` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable base64 output for image generation. | | `output_format` | string | ❌ No | `png` | `png`
`jpg`
`jpeg` | The format in which the generated images are returned. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image - Image Edit Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image/official-format/image-edit POST https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent Smart gemini 2.5 flash image edit tools. Effortless AI-powered photo retouching and creative editing on the fly. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64_encode_data" } } ], "role": "model" }, "finishReason": "STOP", "index": 0 } ], "usageMetadata": { "promptTokenCount": 7, "candidatesTokenCount": 1202, "totalTokenCount": 1347, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 7 } ], "candidatesTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1120 } ], "thoughtsTokenCount": 138 }, "modelVersion": "gemini-3-pro-image-preview", "responseId": "rUhKaeiQJceM-sAP5p7bsAo" } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------------------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | The prompt for generating images. To include images or multiple images, refer to [Multimodal Input](#multimodal-input). | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.responseModalities` | array | ❌ No | - | `TEXT`
`IMAGE` | The modalities of the response. If set for models that don't support these configuration options, the system will return an error. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "a cat" } ] } ] } ``` ```json inlineData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-1-data" } }, { "inlineData": { "mimeType": "image/png", "data": "base64-encoded-image-2-data" } }, { "text": "Combine these two images into a seamless panorama with a mountain background." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "a cat" } ] } ] } ``` ```json fileData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image1.jpg" } }, { "fileData": { "mimeType": "image/png", "fileUri": "https://example.com/image2.png" } }, { "text": "Remove the background from both images and blend them together with a sunset overlay." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1K" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | >`imageConfig.imageSize` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image - Text To Image Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image/official-format/text-to-image POST https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent Responsive gemini 2.5 flash image text to image. The fast and easy way to create custom AI graphics and photos from text. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-image:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64_encode_data" } } ], "role": "model" }, "finishReason": "STOP", "index": 0 } ], "usageMetadata": { "promptTokenCount": 7, "candidatesTokenCount": 1202, "totalTokenCount": 1347, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 7 } ], "candidatesTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1120 } ], "thoughtsTokenCount": 138 }, "modelVersion": "gemini-3-pro-image-preview", "responseId": "rUhKaeiQJceM-sAP5p7bsAo" } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------------------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | The prompt for generating images. To include images or multiple images, refer to [Multimodal Input](#multimodal-input). | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.responseModalities` | array | ❌ No | - | `TEXT`
`IMAGE` | The modalities of the response. If set for models that don't support these configuration options, the system will return an error. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "a cat" } ] } ] } ``` ```json inlineData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-1-data" } }, { "inlineData": { "mimeType": "image/png", "data": "base64-encoded-image-2-data" } }, { "text": "Combine these two images into a seamless panorama with a mountain background." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "a cat" } ] } ] } ``` ```json fileData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image1.jpg" } }, { "fileData": { "mimeType": "image/png", "fileUri": "https://example.com/image2.png" } }, { "text": "Remove the background from both images and blend them together with a sunset overlay." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1K" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | >`imageConfig.imageSize` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image - Image Edit - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image/openai-format/image-edit POST https://gptproto.com/v1/images/edits Versatile gemini 2.5 flash image edit. High-speed AI photo manipulation for social media, marketing, and creative prototyping. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/edits' \ --header 'Authorization: GPTPROTO_API_KEY' \ --form 'model="gemini-2.5-flash-image"' \ --form 'image[]=@"/path/to/file"' \ --form 'prompt="Put a hat on the cat"' ``` ```javascript JavaScript theme={null} const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('model', 'gemini-2.5-flash-image'); data.append('image[]', fs.createReadStream('/path/to/file')); data.append('prompt', 'Put a hat on the cat'); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/edits', headers: { 'Authorization': 'GPTPROTO_API_KEY', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import http.client import mimetypes from codecs import encode conn = http.client.HTTPSConnection("gptproto.com") dataList = [] boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T' dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=model;')) dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode('')) dataList.append(encode("gemini-2.5-flash-image")) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=image[]; filename={0}'.format('file'))) fileType = mimetypes.guess_type('/path/to/file')[0] or 'application/octet-stream' dataList.append(encode('Content-Type: {}'.format(fileType))) dataList.append(encode('')) with open('/path/to/file', 'rb') as f: dataList.append(f.read()) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=prompt;')) dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode('')) dataList.append(encode("Put a hat on the cat")) dataList.append(encode('--'+boundary+'--')) dataList.append(encode('')) body = b'\r\n'.join(dataList) payload = body headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-type': 'multipart/form-data; boundary={}'.format(boundary) } conn.request("POST", "/v1/images/edits", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```go Go theme={null} package main import ( "fmt" "bytes" "mime/multipart" "os" "path/filepath" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/edits" method := "POST" payload := &bytes.Buffer{} writer := multipart.NewWriter(payload) _ = writer.WriteField("model", "gemini-2.5-flash-image") file, errFile2 := os.Open("/path/to/file") defer file.Close() part2, errFile2 := writer.CreateFormFile("image[]",filepath.Base("/path/to/file")) _, errFile2 = io.Copy(part2, file) if errFile2 != nil { fmt.Println(errFile2) return } _ = writer.WriteField("prompt", "Put a hat on the cat") err := writer.Close() if err != nil { fmt.Println(err) return } client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", writer.FormDataContentType()) res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "created": 1768469705199, "data": [ { "b64_json": "BASE64_ENCODED_IMAGE_DATA" } ], "output_format": "jpeg", "quality": "high", "size": "16:9", "usage": { "input_tokens": 3, "input_tokens_details": { "image_tokens": 0, "text_tokens": 3 }, "output_tokens": 1204, "total_tokens": 1330 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | -------------- | -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `gemini-3-pro-image-preview` | - | The model to use for image editing. Defaults to gemini-3-pro-image-preview. | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). | | `image` | string or file | ❌ No | - | - | You can provide up to 14 images. | | `size` | string | ❌ No | `auto` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Equivalent to the `aspect_ratio` field in Google's official format, used to control the aspect ratio of the output image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | ### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. ### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Image - Text To Image - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-image/openai-format/text-to-image POST https://gptproto.com/v1/images/generations Dynamic text to image by gemini 2.5 flash image. Rapidly produce high-quality AI art and photos with extreme efficiency. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash-image", "prompt": "a cat", "size": "16:9" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash-image", "prompt": "a cat", "size": "16:9" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/images/generations" payload = json.dumps({ "model": "gemini-2.5-flash-image", "prompt": "a cat", "size": "16:9" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash-image", "prompt": "a cat", "size": "16:9" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "created": 1768469705199, "data": [ { "b64_json": "BASE64_ENCODED_IMAGE_DATA" } ], "output_format": "jpeg", "quality": "high", "size": "16:9", "usage": { "input_tokens": 3, "input_tokens_details": { "image_tokens": 0, "text_tokens": 3 }, "output_tokens": 1204, "total_tokens": 1330 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | -------------- | -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `gemini-3-pro-image-preview` | - | The model to use for image editing. Defaults to gemini-3-pro-image-preview. | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). | | `image` | string or file | ❌ No | - | - | You can provide up to 14 images. | | `size` | string | ❌ No | `auto` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Equivalent to the `aspect_ratio` field in Google's official format, used to control the aspect ratio of the output image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | ### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. ### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Lite - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-lite/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent Fast gemini 2.5 flash lite file analysis. Efficient document parsing and data extraction for quick insights and summaries. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Lite - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-lite/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent Instant gemini 2.5 flash lite image to text. Accurate OCR and image description for high-speed visual data processing. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Lite - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-lite/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent Speedy gemini 2.5 flash lite text to text. The efficient AI solution for quick chats, drafting, and real-time text generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Lite - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-lite/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent Quick gemini 2.5 flash lite web search. Get the facts fast with real-time internet browsing and concise AI-summarized results. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-lite:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Lite - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-lite/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Efficient file analysis with gemini 2.5 flash lite. Analyze docs and spreadsheets quickly with lightweight AI performance. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Lite - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-lite/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Reliable gemini 2.5 flash lite image to text. Turn photos into text instantly with high-speed AI recognition and analysis. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Lite - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-lite/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Responsive text to text by gemini 2.5 flash lite. Lightweight AI for fast answers, summaries, and creative brainstorming. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash-lite", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Nothinking - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-nothinking/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent Direct gemini 2.5 flash nothinking file analysis. Fast, no-nonsense document processing for immediate data and insights. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Nothinking - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-nothinking/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent Swift gemini 2.5 flash nothinking image to text. Accurate visual recognition for rapid descriptions and text extraction. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Nothinking - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-nothinking/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent Fast text to text via gemini 2.5 flash nothinking. Immediate AI responses for chatting, writing, and simple productivity tasks. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Nothinking - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-nothinking/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent Rapid gemini 2.5 flash nothinking web search. Straightforward internet access for quick facts and up-to-date information. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash-nothinking:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Nothinking - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-nothinking/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Simplified file analysis with gemini 2.5 flash nothinking. Fast document summaries and extraction without extra overhead. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Nothinking - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-nothinking/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Quick gemini 2.5 flash nothinking image to text. Efficient AI vision for instant photo-to-text conversion and descriptions. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash-Nothinking - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash-nothinking/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Direct text to text by gemini 2.5 flash nothinking. High-speed, reliable AI for all your everyday conversational needs. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash-nothinking", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent Powerful gemini 2.5 flash file analysis. Quickly analyze and summarize massive files and data sets with high accuracy. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent Advanced gemini 2.5 flash image to text. Intelligent visual recognition for detailed descriptions and high-speed OCR. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent Dynamic gemini 2.5 flash text to text. High-speed AI generation for creative writing, coding, and professional assistance. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent Smart gemini 2.5 flash web search. Real-time internet browsing for accurate, cited answers on any topic, delivered instantly. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-flash:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Comprehensive file analysis via gemini 2.5 flash. Rapidly process PDFs, code, and documents for better insights and data. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Precision gemini 2.5 flash image to text. Transform visuals into data quickly with cutting-edge AI vision technology. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Flash - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-flash/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Efficient text to text with gemini 2.5 flash. The versatile AI model for high-speed, high-quality content and communication. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro-Deepsearch - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro-deepsearch/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent Intense gemini 2.5 pro deepsearch file analysis. Thoroughly audit and analyze complex files with advanced search and logic. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro-Deepsearch - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro-deepsearch/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent Expert gemini 2.5 pro deepsearch image to text. Deep visual analysis for highly detailed descriptions and technical extraction. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro-Deepsearch - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro-deepsearch/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent Premium gemini 2.5 pro deepsearch text to text. Advanced reasoning and research-driven generation for complex professional tasks. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro-Deepsearch - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro-deepsearch/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent Master-level gemini 2.5 pro deepsearch web search. Comprehensive internet research with multi-step reasoning for verified answers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-pro-deepsearch:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro-Deepsearch - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro-deepsearch/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Deep-dive file analysis with gemini 2.5 pro deepsearch. Professional-grade extraction and logic for technical documentation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro-Deepsearch - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro-deepsearch/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Nuanced gemini 2.5 pro deepsearch image to text. Superior vision AI that understands complex scenes and provides rich context. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro-Deepsearch - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro-deepsearch/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Elite text to text via gemini 2.5 pro deepsearch. Sophisticated AI for high-stakes research, writing, and logical problem solving. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-pro-deepsearch", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent Professional gemini 2.5 pro file analysis. Securely process and understand large documents with high-context AI precision. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent Detailed gemini 2.5 pro image to text. Accurate and descriptive visual analysis for professional creative and technical needs. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent Exceptional gemini 2.5 pro text to text. High-IQ generation for creative projects, complex coding, and academic-level writing. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent In-depth gemini 2.5 pro web search. Real-time internet browsing with professional synthesis for accurate and cited information. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingBudget": 1000 } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions High-context file analysis with gemini 2.5 pro. Master your documents with advanced extraction and expert summarization. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Superior gemini 2.5 pro image to text. Industry-leading vision AI for complex image descriptions and precise data retrieval. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-2.5-Pro - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-2.5-pro/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Elite text to text by gemini 2.5 pro. The power-user choice for sophisticated content creation and advanced problem-solving. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-2.5-pro", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Flash-Preview - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-flash-preview/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent Cutting-edge gemini 3 flash preview file analysis. Experience the future of fast, intelligent document processing and data extraction. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Flash-Preview - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-flash-preview/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent Next-gen gemini 3 flash preview image to text. Ultra-fast, highly accurate visual recognition for the most demanding vision tasks. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Flash-Preview - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-flash-preview/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent Vibrant gemini 3 flash preview text to text. High-speed, next-generation AI for creative writing, chatting, and complex workflows. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Flash-Preview - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-flash-preview/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent Future-ready gemini 3 flash preview web search. Lightning-fast internet research with state-of-the-art information synthesis. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-flash-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Flash-Preview - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-flash-preview/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Innovative file analysis with gemini 3 flash preview. Rapid document insights and high-accuracy parsing for professional users. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Flash-Preview - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-flash-preview/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Smart gemini 3 flash preview image to text. Advanced vision AI for instant descriptions and precise data from any visual source. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Flash-Preview - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-flash-preview/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Powerful text to text via gemini 3 flash preview. Experience next-level speed and intelligence for all your content generation needs. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Image-Preview - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-image-preview/gptproto-format/image-edit POST https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit Advanced gemini 3 pro image edit preview. State-of-the-art AI tools for professional photo manipulation and creative styling. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "size": "1K", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "size": "1K", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit" payload = json.dumps({ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "size": "1K", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": False, "enable_sync_mode": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "size": "1K", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | | ---------------- | ----------------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image` | | `image-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit` | ### Core Body Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. | | `image` | array | ❌ No | - | - | Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 14 images. | ### Advanced Body Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `size` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`4:5`
`5:4`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | The aspect ratio of the generated image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `top_p` | number | ❌ No | - | - | Controls the diversity of the output. | | `enable_sync_mode` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable synchronous mode for image generation. | | `enable_base64_output` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable base64 output for image generation. | | `output_format` | string | ❌ No | `png` | `png`
`jpg`
`jpeg` | The format in which the generated images are returned. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Image-Preview - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-image-preview/gptproto-format/text-to-image POST https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image Next-gen gemini 3 pro image preview text to image. Create stunning, high-resolution AI art with the latest model technology. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "size": "1K", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "size": "1K", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image" payload = json.dumps({ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "size": "1K", "temperature": 1, "topP": 0.95, "enable_base64_output": False, "enable_sync_mode": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "size": "1K", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | | ---------------- | ----------------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image` | | `image-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit` | ### Core Body Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. | | `image` | array | ❌ No | - | - | Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 14 images. | ### Advanced Body Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `size` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`4:5`
`5:4`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | The aspect ratio of the generated image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `top_p` | number | ❌ No | - | - | Controls the diversity of the output. | | `enable_sync_mode` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable synchronous mode for image generation. | | `enable_base64_output` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable base64 output for image generation. | | `output_format` | string | ❌ No | `png` | `png`
`jpg`
`jpeg` | The format in which the generated images are returned. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Image-Preview - Image Edit Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-image-preview/official-format/image-edit POST https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent Elite image edit with gemini 3 pro image preview. Experience the future of AI-powered photo retouching and visual effects. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64_encode_data" } } ], "role": "model" }, "finishReason": "STOP", "index": 0 } ], "usageMetadata": { "promptTokenCount": 7, "candidatesTokenCount": 1202, "totalTokenCount": 1347, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 7 } ], "candidatesTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1120 } ], "thoughtsTokenCount": 138 }, "modelVersion": "gemini-3-pro-image-preview", "responseId": "rUhKaeiQJceM-sAP5p7bsAo" } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------------------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | The prompt for generating images. To include images or multiple images, refer to [Multimodal Input](#multimodal-input). | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.responseModalities` | array | ❌ No | - | `TEXT`
`IMAGE` | The modalities of the response. If set for models that don't support these configuration options, the system will return an error. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "a cat" } ] } ] } ``` ```json inlineData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-1-data" } }, { "inlineData": { "mimeType": "image/png", "data": "base64-encoded-image-2-data" } }, { "text": "Combine these two images into a seamless panorama with a mountain background." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "a cat" } ] } ] } ``` ```json fileData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image1.jpg" } }, { "fileData": { "mimeType": "image/png", "fileUri": "https://example.com/image2.png" } }, { "text": "Remove the background from both images and blend them together with a sunset overlay." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1K" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | >`imageConfig.imageSize` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Image-Preview - Text To Image Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-image-preview/official-format/text-to-image POST https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent Premium text to image by gemini 3 pro image preview. Superior artistic quality and photorealism for high-end digital creation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-image-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64_encode_data" } } ], "role": "model" }, "finishReason": "STOP", "index": 0 } ], "usageMetadata": { "promptTokenCount": 7, "candidatesTokenCount": 1202, "totalTokenCount": 1347, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 7 } ], "candidatesTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1120 } ], "thoughtsTokenCount": 138 }, "modelVersion": "gemini-3-pro-image-preview", "responseId": "rUhKaeiQJceM-sAP5p7bsAo" } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------------------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | The prompt for generating images. To include images or multiple images, refer to [Multimodal Input](#multimodal-input). | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.responseModalities` | array | ❌ No | - | `TEXT`
`IMAGE` | The modalities of the response. If set for models that don't support these configuration options, the system will return an error. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "a cat" } ] } ] } ``` ```json inlineData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-1-data" } }, { "inlineData": { "mimeType": "image/png", "data": "base64-encoded-image-2-data" } }, { "text": "Combine these two images into a seamless panorama with a mountain background." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "a cat" } ] } ] } ``` ```json fileData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image1.jpg" } }, { "fileData": { "mimeType": "image/png", "fileUri": "https://example.com/image2.png" } }, { "text": "Remove the background from both images and blend them together with a sunset overlay." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1K" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | >`imageConfig.imageSize` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Image-Preview - Image Edit - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-image-preview/openai-format/image-edit POST https://gptproto.com/v1/images/edits Professional gemini 3 pro image edit preview. Master your photos with cutting-edge AI tools for perfect visual adjustments. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/edits' \ --header 'Authorization: GPTPROTO_API_KEY' \ --form 'model="gemini-3-pro-image-preview"' \ --form 'image[]=@"/path/to/file"' \ --form 'prompt="Put a hat on the cat"' ``` ```javascript JavaScript theme={null} const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('model', 'gemini-3-pro-image-preview'); data.append('image[]', fs.createReadStream('/path/to/file')); data.append('prompt', 'Put a hat on the cat'); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/edits', headers: { 'Authorization': 'GPTPROTO_API_KEY', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import http.client import mimetypes from codecs import encode conn = http.client.HTTPSConnection("gptproto.com") dataList = [] boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T' dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=model;')) dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode('')) dataList.append(encode("gemini-3-pro-image-preview")) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=image[]; filename={0}'.format('file'))) fileType = mimetypes.guess_type('/path/to/file')[0] or 'application/octet-stream' dataList.append(encode('Content-Type: {}'.format(fileType))) dataList.append(encode('')) with open('/path/to/file', 'rb') as f: dataList.append(f.read()) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=prompt;')) dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode('')) dataList.append(encode("Put a hat on the cat")) dataList.append(encode('--'+boundary+'--')) dataList.append(encode('')) body = b'\r\n'.join(dataList) payload = body headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-type': 'multipart/form-data; boundary={}'.format(boundary) } conn.request("POST", "/v1/images/edits", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```go Go theme={null} package main import ( "fmt" "bytes" "mime/multipart" "os" "path/filepath" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/edits" method := "POST" payload := &bytes.Buffer{} writer := multipart.NewWriter(payload) _ = writer.WriteField("model", "gemini-3-pro-image-preview") file, errFile2 := os.Open("/path/to/file") defer file.Close() part2, errFile2 := writer.CreateFormFile("image[]",filepath.Base("/path/to/file")) _, errFile2 = io.Copy(part2, file) if errFile2 != nil { fmt.Println(errFile2) return } _ = writer.WriteField("prompt", "Put a hat on the cat") err := writer.Close() if err != nil { fmt.Println(err) return } client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", writer.FormDataContentType()) res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "created": 1768469705199, "data": [ { "b64_json": "BASE64_ENCODED_IMAGE_DATA" } ], "output_format": "jpeg", "quality": "high", "size": "16:9", "usage": { "input_tokens": 3, "input_tokens_details": { "image_tokens": 0, "text_tokens": 3 }, "output_tokens": 1204, "total_tokens": 1330 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | -------------- | -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `gemini-3-pro-image-preview` | - | The model to use for image editing. Defaults to gemini-3-pro-image-preview. | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). | | `image` | string or file | ❌ No | - | - | You can provide up to 14 images. | | `size` | string | ❌ No | `auto` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Equivalent to the `aspect_ratio` field in Google's official format, used to control the aspect ratio of the output image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | ### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. ### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Image-Preview - Text To Image - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-image-preview/openai-format/text-to-image POST https://gptproto.com/v1/images/generations Stunning text to image via gemini 3 pro image preview. The pinnacle of AI image generation for creative and professional work. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-pro-image-preview", "prompt": "a cat", "size": "16:9" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-pro-image-preview", "prompt": "a cat", "size": "16:9" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/images/generations" payload = json.dumps({ "model": "gemini-3-pro-image-preview", "prompt": "a cat", "size": "16:9" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-pro-image-preview", "prompt": "a cat", "size": "16:9" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "created": 1768469705199, "data": [ { "b64_json": "BASE64_ENCODED_IMAGE_DATA" } ], "output_format": "jpeg", "quality": "high", "size": "16:9", "usage": { "input_tokens": 3, "input_tokens_details": { "image_tokens": 0, "text_tokens": 3 }, "output_tokens": 1204, "total_tokens": 1330 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | -------------- | -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `gemini-3-pro-image-preview` | - | The model to use for image editing. Defaults to gemini-3-pro-image-preview. | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). | | `image` | string or file | ❌ No | - | - | You can provide up to 14 images. | | `size` | string | ❌ No | `auto` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Equivalent to the `aspect_ratio` field in Google's official format, used to control the aspect ratio of the output image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | ### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. ### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview-11-2025 - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview-11-2025/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent Comprehensive gemini 3 pro preview file analysis. Deep document understanding and precise data extraction from the latest AI model. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview-11-2025 - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview-11-2025/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent Elite gemini 3 pro preview image to text. High-detail visual analysis and sophisticated scene description for professional needs. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview-11-2025 - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview-11-2025/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent State-of-the-art gemini 3 pro preview text to text. Superior intelligence for complex coding, creative writing, and reasoning. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview-11-2025 - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview-11-2025/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent Next-level gemini 3 pro preview web search. Real-time internet access with professional-grade research and cited summaries. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-preview-11-2025:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview-11-2025 - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview-11-2025/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Advanced file analysis with gemini 3 pro preview. Expertly parse and summarize complex files with high-context AI precision. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview-11-2025 - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview-11-2025/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Precise gemini 3 pro preview image to text. Industry-leading vision AI for detailed image understanding and data retrieval. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview-11-2025 - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview-11-2025/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Master text to text by gemini 3 pro preview. High-IQ AI partner for sophisticated content creation and strategic problem-solving. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-pro-preview-11-2025", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent Deep gemini 3 pro preview file analysis. High-intelligence document processing for complex research and business intelligence. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent Sophisticated gemini 3 pro preview image to text. Advanced vision technology for rich image descriptions and precise data. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent Powerful gemini 3 pro preview text to text. Elite AI performance for complex reasoning, creative drafting, and technical work. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent Expert web search with gemini 3 pro preview. Comprehensive internet research and synthesis for the most accurate current information. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3-pro-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Professional file analysis via gemini 3 pro preview. Deep-dive into technical documents with unparalleled AI understanding. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Nuanced gemini 3 pro preview image to text. Capture every detail with industry-leading AI vision for high-end professional use. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3-Pro-Preview - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3-pro-preview/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Elite text to text by gemini 3 pro preview. Exceptional intelligence for high-stakes creative, technical, and analytical projects. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Image-Preview - Image Edit - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-image-preview/gptproto-format/image-edit POST https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/image-edit Rapid gemini 3.1 flash image edit preview. Experience the latest in high-speed AI photo retouching and creative transformations. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/image-edit' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "size": "1K", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "size": "1K", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/image-edit', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/image-edit" payload = json.dumps({ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "size": "1K", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": False, "enable_sync_mode": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/image-edit" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "output_format": "jpeg", "size": "1K", "aspect_ratio": "1:1", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | | ---------------- | ----------------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image` | | `image-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit` | ### Core Body Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. | | `image` | array | ❌ No | - | - | Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 14 images. | ### Advanced Body Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `size` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`4:5`
`5:4`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | The aspect ratio of the generated image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `top_p` | number | ❌ No | - | - | Controls the diversity of the output. | | `enable_sync_mode` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable synchronous mode for image generation. | | `enable_base64_output` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable base64 output for image generation. | | `output_format` | string | ❌ No | `png` | `png`
`jpg`
`jpeg` | The format in which the generated images are returned. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Image-Preview - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-image-preview/gptproto-format/text-to-image POST https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/text-to-image Stunning gemini 3.1 flash image preview text to image. Create high-resolution AI art instantly with next-gen model performance. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "size": "1K", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "size": "1K", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/text-to-image" payload = json.dumps({ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "size": "1K", "temperature": 1, "topP": 0.95, "enable_base64_output": False, "enable_sync_mode": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/gemini-3.1-flash-image-preview/text-to-image" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "output_format": "jpeg", "aspect_ratio": "1:1", "size": "1K", "temperature": 1, "topP": 0.95, "enable_base64_output": false, "enable_sync_mode": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | | ---------------- | ----------------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/text-to-image` | | `image-to-video` | `https://gptproto.com/api/v3/google/gemini-3-pro-image-preview/image-edit` | ### Core Body Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). The maximum length is 32000 characters. | | `image` | array | ❌ No | - | - | Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 14 images. | ### Advanced Body Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `size` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`4:5`
`5:4`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | The aspect ratio of the generated image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `top_p` | number | ❌ No | - | - | Controls the diversity of the output. | | `enable_sync_mode` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable synchronous mode for image generation. | | `enable_base64_output` | boolean | ❌ No | `false` | `true`
`false` | Whether to enable base64 output for image generation. | | `output_format` | string | ❌ No | `png` | `png`
`jpg`
`jpeg` | The format in which the generated images are returned. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Image-Preview - Image Edit Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-image-preview/official-format/image-edit POST https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent Innovative image edit via gemini 3.1 flash image preview. Fast, reliable AI tools for pro-level photo manipulation and styling. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" }, { "fileData": { "mimeType": "image/png", "fileUri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64_encode_data" } } ], "role": "model" }, "finishReason": "STOP", "index": 0 } ], "usageMetadata": { "promptTokenCount": 7, "candidatesTokenCount": 1202, "totalTokenCount": 1347, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 7 } ], "candidatesTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1120 } ], "thoughtsTokenCount": 138 }, "modelVersion": "gemini-3-pro-image-preview", "responseId": "rUhKaeiQJceM-sAP5p7bsAo" } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------------------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | The prompt for generating images. To include images or multiple images, refer to [Multimodal Input](#multimodal-input). | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.responseModalities` | array | ❌ No | - | `TEXT`
`IMAGE` | The modalities of the response. If set for models that don't support these configuration options, the system will return an error. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "a cat" } ] } ] } ``` ```json inlineData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-1-data" } }, { "inlineData": { "mimeType": "image/png", "data": "base64-encoded-image-2-data" } }, { "text": "Combine these two images into a seamless panorama with a mountain background." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "a cat" } ] } ] } ``` ```json fileData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image1.jpg" } }, { "fileData": { "mimeType": "image/png", "fileUri": "https://example.com/image2.png" } }, { "text": "Remove the background from both images and blend them together with a sunset overlay." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1K" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | >`imageConfig.imageSize` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Image-Preview - Text To Image Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-image-preview/official-format/text-to-image POST https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent Dynamic text to image by gemini 3.1 flash image preview. Rapidly generate beautiful, detailed visuals for any creative task. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Put a hat on the cat" } ] } ], "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "4K" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64_encode_data" } } ], "role": "model" }, "finishReason": "STOP", "index": 0 } ], "usageMetadata": { "promptTokenCount": 7, "candidatesTokenCount": 1202, "totalTokenCount": 1347, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 7 } ], "candidatesTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1120 } ], "thoughtsTokenCount": 138 }, "modelVersion": "gemini-3-pro-image-preview", "responseId": "rUhKaeiQJceM-sAP5p7bsAo" } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------------------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | The prompt for generating images. To include images or multiple images, refer to [Multimodal Input](#multimodal-input). | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.responseModalities` | array | ❌ No | - | `TEXT`
`IMAGE` | The modalities of the response. If set for models that don't support these configuration options, the system will return an error. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "a cat" } ] } ] } ``` ```json inlineData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-1-data" } }, { "inlineData": { "mimeType": "image/png", "data": "base64-encoded-image-2-data" } }, { "text": "Combine these two images into a seamless panorama with a mountain background." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "a cat" } ] } ] } ``` ```json fileData with multiple images theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image1.jpg" } }, { "fileData": { "mimeType": "image/png", "fileUri": "https://example.com/image2.png" } }, { "text": "Remove the background from both images and blend them together with a sunset overlay." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `image/png`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1K" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | | >`imageConfig.imageSize` | string | ❌ No | - | `0.5K`
`1K`
`2K`
`4K` | Approximate size of the generated image. If not specified, the model will use the default value of 1K. `0.5K` is only supported by Gemini 3.1 Flash Image Preview; `2K` and `4K` are only supported by Gemini 3.1 Flash Image Preview and Gemini 3 Pro Image Preview. | #### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. #### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Image-Preview - Image Edit - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-image-preview/openai-format/image-edit POST https://gptproto.com/v1/images/edits Efficient gemini 3.1 flash image edit preview. Pro-grade photo editing tools optimized for speed and creative flexibility. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/edits' \ --header 'Authorization: GPTPROTO_API_KEY' \ --form 'model="gemini-3.1-flash-image-preview"' \ --form 'image[]=@"/path/to/file"' \ --form 'prompt="Put a hat on the cat"' ``` ```javascript JavaScript theme={null} const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('model', 'gemini-3.1-flash-image-preview'); data.append('image[]', fs.createReadStream('/path/to/file')); data.append('prompt', 'Put a hat on the cat'); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/edits', headers: { 'Authorization': 'GPTPROTO_API_KEY', ...data.getHeaders() }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import http.client import mimetypes from codecs import encode conn = http.client.HTTPSConnection("gptproto.com") dataList = [] boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T' dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=model;')) dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode('')) dataList.append(encode("gemini-3.1-flash-image-preview")) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=image[]; filename={0}'.format('file'))) fileType = mimetypes.guess_type('/path/to/file')[0] or 'application/octet-stream' dataList.append(encode('Content-Type: {}'.format(fileType))) dataList.append(encode('')) with open('/path/to/file', 'rb') as f: dataList.append(f.read()) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=prompt;')) dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode('')) dataList.append(encode("Put a hat on the cat")) dataList.append(encode('--'+boundary+'--')) dataList.append(encode('')) body = b'\r\n'.join(dataList) payload = body headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-type': 'multipart/form-data; boundary={}'.format(boundary) } conn.request("POST", "/v1/images/edits", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```go Go theme={null} package main import ( "fmt" "bytes" "mime/multipart" "os" "path/filepath" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/edits" method := "POST" payload := &bytes.Buffer{} writer := multipart.NewWriter(payload) _ = writer.WriteField("model", "gemini-3.1-flash-image-preview") file, errFile2 := os.Open("/path/to/file") defer file.Close() part2, errFile2 := writer.CreateFormFile("image[]",filepath.Base("/path/to/file")) _, errFile2 = io.Copy(part2, file) if errFile2 != nil { fmt.Println(errFile2) return } _ = writer.WriteField("prompt", "Put a hat on the cat") err := writer.Close() if err != nil { fmt.Println(err) return } client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", writer.FormDataContentType()) res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "created": 1768469705199, "data": [ { "b64_json": "BASE64_ENCODED_IMAGE_DATA" } ], "output_format": "jpeg", "quality": "high", "size": "16:9", "usage": { "input_tokens": 3, "input_tokens_details": { "image_tokens": 0, "text_tokens": 3 }, "output_tokens": 1204, "total_tokens": 1330 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | -------------- | -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `gemini-3-pro-image-preview` | - | The model to use for image editing. Defaults to gemini-3-pro-image-preview. | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). | | `image` | string or file | ❌ No | - | - | You can provide up to 14 images. | | `size` | string | ❌ No | `auto` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Equivalent to the `aspect_ratio` field in Google's official format, used to control the aspect ratio of the output image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | ### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. ### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Image-Preview - Text To Image - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-image-preview/openai-format/text-to-image POST https://gptproto.com/v1/images/generations Elite text to image via gemini 3.1 flash image preview. High-speed, high-detail AI generation for modern designers and creators. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.1-flash-image-preview", "prompt": "a cat", "size": "16:9" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.1-flash-image-preview", "prompt": "a cat", "size": "16:9" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/images/generations" payload = json.dumps({ "model": "gemini-3.1-flash-image-preview", "prompt": "a cat", "size": "16:9" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.1-flash-image-preview", "prompt": "a cat", "size": "16:9" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "created": 1768469705199, "data": [ { "b64_json": "BASE64_ENCODED_IMAGE_DATA" } ], "output_format": "jpeg", "quality": "high", "size": "16:9", "usage": { "input_tokens": 3, "input_tokens_details": { "image_tokens": 0, "text_tokens": 3 }, "output_tokens": 1204, "total_tokens": 1330 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | --------- | -------------- | -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | `gemini-3-pro-image-preview` | - | The model to use for image editing. Defaults to gemini-3-pro-image-preview. | | `prompt` | string | ✅ Yes | - | - | A text description of the desired image(s). | | `image` | string or file | ❌ No | - | - | You can provide up to 14 images. | | `size` | string | ❌ No | `auto` | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9`
`1:4`
`4:1`
`1:8`
`8:1` | Equivalent to the `aspect_ratio` field in Google's official format, used to control the aspect ratio of the output image. `1:4`, `4:1`, `1:8`, `8:1` are only supported by Gemini 3.1 Flash Image Preview. | ### Model Comparison | Feature | Gemini 2.5 Flash Image | Gemini 3.1 Flash Image Preview | Gemini 3 Pro Image Preview | | ----------------------------- | ---------------------- | ------------------------------ | ----------------------------- | | Use case | Speed & efficiency | Speed & high-volume | Professional asset production | | Supported sizes | 1K | 0.5K, 1K, 2K, 4K | 1K, 2K, 4K | | Max reference images | 3 | 14 | 14 | | Max object images | — | 10 | 6 | | Max portrait images | — | 4 | 5 | | Extra aspect ratios | — | 1:4, 4:1, 1:8, 8:1 | — | | Google Image Search Grounding | — | ✅ | — | **Note:** * **Gemini 3.1 Flash Image Preview**: Optimized for speed and high-volume use cases. Supports 0.5K resolution and extra ultra-wide/tall aspect ratios (1:4, 4:1, 1:8, 8:1). Also supports Google Image Search Grounding. * **Gemini 3 Pro Image Preview**: Optimized for professional asset production with advanced reasoning for complex creation tasks. * **Gemini 2.5 Flash Image**: Supports a maximum of 3 reference images and 1K resolution only. ### Aspect Ratio & Image Size By default, the model keeps the output image the same size as the input image; otherwise it produces a 1:1 square. You can control the aspect ratio of the generated image with the `aspect_ratio` field under `image_config` in your request, as shown below: **Gemini 2.5 Flash Image** | Aspect ratio | Resolution | Tokens | | ------------ | ---------- | ------ | | 1:1 | 1024x1024 | 1290 | | 2:3 | 832x1248 | 1290 | | 3:2 | 1248x832 | 1290 | | 3:4 | 864x1184 | 1290 | | 4:3 | 1184x864 | 1290 | | 4:5 | 896x1152 | 1290 | | 5:4 | 1152x896 | 1290 | | 9:16 | 768x1344 | 1290 | | 16:9 | 1344x768 | 1290 | | 21:9 | 1536x672 | 1290 | **Gemini 3.1 Flash Image Preview** | Aspect ratio | 512px resolution | 0.5K tokens | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ---------------- | ----------- | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 512x512 | 747 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 1:4 | 256x1024 | 747 | 512x2048 | 1120 | 1024x4096 | 1120 | 2048x8192 | 2000 | | 1:8 | 192x1536 | 747 | 384x3072 | 1120 | 768x6144 | 1120 | 1536x12288 | 2000 | | 2:3 | 424x632 | 747 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 632x424 | 747 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 448x600 | 747 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:1 | 1024x256 | 747 | 2048x512 | 1120 | 4096x1024 | 1120 | 8192x2048 | 2000 | | 4:3 | 600x448 | 747 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 464x576 | 747 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 576x464 | 747 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 8:1 | 1536x192 | 747 | 3072x384 | 1120 | 6144x768 | 1120 | 12288x1536 | 2000 | | 9:16 | 384x688 | 747 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 688x384 | 747 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 792x336 | 747 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | **Gemini 3 Pro Image Preview** | Aspect ratio | 1K resolution | 1K tokens | 2K resolution | 2K tokens | 4K resolution | 4K tokens | | ------------ | ------------- | --------- | ------------- | --------- | ------------- | --------- | | 1:1 | 1024x1024 | 1120 | 2048x2048 | 1120 | 4096x4096 | 2000 | | 2:3 | 848x1264 | 1120 | 1696x2528 | 1120 | 3392x5056 | 2000 | | 3:2 | 1264x848 | 1120 | 2528x1696 | 1120 | 5056x3392 | 2000 | | 3:4 | 896x1200 | 1120 | 1792x2400 | 1120 | 3584x4800 | 2000 | | 4:3 | 1200x896 | 1120 | 2400x1792 | 1120 | 4800x3584 | 2000 | | 4:5 | 928x1152 | 1120 | 1856x2304 | 1120 | 3712x4608 | 2000 | | 5:4 | 1152x928 | 1120 | 2304x1856 | 1120 | 4608x3712 | 2000 | | 9:16 | 768x1376 | 1120 | 1536x2752 | 1120 | 3072x5504 | 2000 | | 16:9 | 1376x768 | 1120 | 2752x1536 | 1120 | 5504x3072 | 2000 | | 21:9 | 1584x672 | 1120 | 3168x1344 | 1120 | 6336x2688 | 2000 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Lite-Preview - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-lite-preview/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent Lite gemini 3.1 flash preview file analysis. High-speed document parsing and data extraction with the latest AI technology. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Lite-Preview - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-lite-preview/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent Swift gemini 3.1 flash lite preview image to text. Accurate visual recognition and descriptions at ultra-fast speeds. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Lite-Preview - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-lite-preview/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent Quick text to text via gemini 3.1 flash lite preview. Efficient, state-of-the-art AI for rapid chatting and content drafting. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Lite-Preview - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-lite-preview/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent Rapid gemini 3.1 flash lite preview web search. Instant internet research and cited answers from the most current AI model. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Lite-Preview - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-lite-preview/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Efficient file analysis with gemini 3.1 flash lite preview. Summarize docs and extract info quickly with next-gen AI. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Lite-Preview - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-lite-preview/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Smart gemini 3.1 flash lite preview image to text. Turn visuals into text instantly with high-speed, reliable AI recognition. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Flash-Lite-Preview - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-flash-lite-preview/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Responsive text to text by gemini 3.1 flash lite preview. The fast choice for modern AI communication and content creation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.1-flash-lite-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Pro-Preview - File Analysis Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-pro-preview/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent Elite gemini 3.1 pro preview file analysis. Sophisticated document understanding and technical extraction for pro researchers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Pro-Preview - Image To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-pro-preview/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent Master gemini 3.1 pro preview image to text. High-fidelity visual analysis and rich scene description from the latest AI model. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Pro-Preview - Text To Text Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-pro-preview/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent Supreme gemini 3.1 pro preview text to text. Professional-grade intelligence for complex reasoning, coding, and creativity. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Pro-Preview - Web Search Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-pro-preview/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent Global gemini 3.1 pro preview web search. Deep-dive internet research with professional synthesis and accurate cited answers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.1-pro-preview:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Pro-Preview - File Analysis - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-pro-preview/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions Advanced file analysis via gemini 3.1 pro preview. The ultimate tool for parsing and summarizing complex technical documents. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Pro-Preview - Image To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-pro-preview/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions Superior gemini 3.1 pro preview image to text. Unmatched vision AI for detailed image interpretation and technical data. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Gemini-3.1-Pro-Preview - Text To Text - openai Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.1-pro-preview/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions Elite text to text by gemini 3.1 pro preview. Experience the pinnacle of AI-driven creative and technical content generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.1-pro-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # gemini-3.5-flash (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.5-flash/official-format/file-analysis POST https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "what is in this file?" }, { "file_data": { "mime_type": "application/pdf", "file_uri": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # gemini-3.5-flash (Image To Text) Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.5-flash/official-format/image-to-text POST https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "What is shown in this PNG image?" }, { "file_data": { "mime_type": "image/png", "file_uri": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # gemini-3.5-flash (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.5-flash/official-format/text-to-text POST https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "who are you?" } ] } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # gemini-3.5-flash (Web Search) Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.5-flash/official-format/web-search POST https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent" payload = json.dumps({ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": True, "thinkingLevel": "HIGH" } } }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/gemini-3.5-flash:generateContent" method := "POST" payload := strings.NewReader(`{ "contents": [ { "role": "user", "parts": [ { "text": "Who won the euro 2024?" } ] } ], "tools": [ { "google_search": {} } ], "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "This image depicts a cozy, serene indoor scene, likely generated by AI or created as digital art, characterized by warm lighting and a peaceful atmosphere. Here are the key elements shown:\n\n**The Subject:**\n* **The Cat:** The central focus is a fluffy, orange (ginger) tabby cat sitting upright on a wooden window sill. The cat has striking green eyes, long white whiskers, and a very bushy tail that curls slightly over the edge of the sill. It is looking forward with a calm expression.\n\n**The Setting:**\n* **Window:** The cat is positioned in front of a large window with a wooden frame. Through the glass, you can see large trees with green foliage, suggesting a garden or park outside. The background is blurred (bokeh effect), keeping the focus on the interior.\n* **Lighting:** Soft, golden sunlight is streaming in from the left, illuminating the cat's fur and creating a halo effect. There are visible dust motes or magical sparkles floating in the sunbeams, adding to the dreamy quality.\n\n**Surrounding Objects:**\n* **Book:** To the left of the cat on the window sill, there is a thick, closed book lying flat.\n* **Tea:** In the lower right corner, sitting on a small round wooden side table, is a teacup on a saucer. Steam is rising from the cup, indicating a hot beverage. A tea bag tag hangs over the side.\n* **Interior Details:** On the right side of the image, there is a dark wooden bookshelf filled with books. Partially visible is a brown leather armchair with a chunky, cream-colored knit blanket draped over it, enhancing the \"hygge\" or cozy feel.\n* **Wall Art:** A framed picture hangs on the wall near the bookshelf, though the image inside the frame is indistinct.\n\nOverall, the image conveys a sense of comfort, quiet contemplation, and the warmth of a relaxing afternoon.", "thoughtSignature": "Cv0oAY89a19fZ/pV0io*****" } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 1097, "candidatesTokenCount": 403, "totalTokenCount": 2779, "trafficType": "ON_DEMAND", "promptTokensDetails": [ { "modality": "IMAGE", "tokenCount": 1089 }, { "modality": "TEXT", "tokenCount": 8 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 403 } ], "thoughtsTokenCount": 1279 }, "modelVersion": "gemini-2.5-pro", "createTime": "2025-12-22T13:20:13.753813Z", "responseId": "jUVJaZWBLvzN998P1tDo4Q0" } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:{method}` Google Gemini API provides two methods for content generation, distinguished by whether they return responses incrementally (streaming) or all at once (non-streaming). | Method | Example | Description | | ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `generateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:generateContent` | Generates a complete response all at once. Best for applications where you need the full response before processing. | | `streamGenerateContent` | `https://gptproto.com/v1beta/models/gemini-2.5-pro:streamGenerateContent` | Streams the response incrementally as it's generated. Ideal for chat interfaces and real-time applications where latency is important. | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | ------ | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `contents` | array | ✅ Yes | - | - | Content of the current conversation with the model. For single-turn queries, this contains one instance. For multi-turn queries (e.g., chat), this contains the conversation history and the latest request. | | >`contents.role` | string | ✅ Yes | - | `user`
`model` | The role of the message sender. | | >`contents.parts` | array | ✅ Yes | - | - | The content parts of the message, which can contain different types of content (text, inlineData, etc.). | | >>`contents.parts.text` | string | ✅ Yes | - | - | Text content of the part. For multimodal input details, see [Multimodal Input](#multimodal-input). | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------------------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | List of tools the model may use to generate the next response. Supported tools include Function and codeExecution. | | `toolConfig` | object | ❌ No | - | - | Configuration for any tools specified in the request. | | `safetySettings` | array | ❌ No | - | - | List of unique SafetySetting instances for filtering unsafe content. Each SafetyCategory should have at most one setting. see [SafetySetting](#safetySetting) | | `generationConfig` | object | ❌ No | - | - | Configuration options for content generation. | | >`generationConfig.temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. Lower values produce more deterministic results. | | >`generationConfig.topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling probability threshold. | | >`generationConfig.topK` | integer | ❌ No | - | - | Top-k sampling parameter. | | >`generationConfig.maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | >`generationConfig.thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. If set for models that don't support thinking, the system will return an error. See [Thinking Config](#thinking-config) for details. | | >`generationConfig.imageConfig` | object | ❌ No | - | - | Configuration for image generation. If set for models that don't support these configuration options, the system will return an error. See [Image Config](#image-config) for details. | | >`generationConfig.mediaResolution` | enum | ❌ No | - | `MEDIA_RESOLUTION_UNSPECIFIED`
`MEDIA_RESOLUTION_LOW`
`MEDIA_RESOLUTION_MEDIUM`
`MEDIA_RESOLUTION_HIGH` | If specified, uses the specified media resolution.
**Note:** This field describes the resolution of input media. To control the resolution of output images, use the `imageConfig` field instead. | ### Multimodal Input ```json inlineData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "base64-encoded-image-data" } }, { "text": "Describe this image." } ] } ] } ``` ```json inlineData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "application/pdf", "data": "base64-encoded-pdf-data" } }, { "text": "Summarize the content of this PDF document." } ] } ] } ``` ```json fileData with image theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "image/jpeg", "fileUri": "https://example.com/image.jpg" } }, { "text": "What is shown in this JPEG image?" } ] } ] } ``` ```json fileData with PDF theme={null} { "contents": [ { "role": "user", "parts": [ { "fileData": { "mimeType": "application/pdf", "fileUri": "https://example.com/file.pdf" } }, { "text": "Extract key information from this PDF file." } ] } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | | -------------------------------------- | ------ | ------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | - | | `contents.parts` | array | ✅ Yes | — | `text`
`inlineData`
`fileData` | The content parts of the message, which can contain different types of content . | | | >`contents.parts.inlineData` | object | ❌ No | - | - | Inline media content. If used, `data` must be base64-encoded. | | | >>`contents.parts.inlineData.mimeType` | string | ✅ Yes (if inline\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.inlineData.data` | string | ✅ Yes (if inline\_data is used) | - | - | Base64-encoded media data. | | | >`contents.parts.fileData` | object | ❌ No | - | - | File media content. If used, `fileUri` must be provided. | | | >>`contents.parts.fileData.mimeType` | string | ✅ Yes (if file\_data is used) | - | `application/pdf`
`image/jpeg` | The IANA-standard MIME type of the source data. If the provided MIME type is not supported, the system will return an error. | | | >>`contents.parts.fileData.fileUri` | string | ✅ Yes (if file\_data is used) | - | - | The URI of the file to be processed. | | ### Safety Settings ```json Safety settings theme={null} { "safetySettings": [ { "category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE" }, { "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_HIGH_AND_ABOVE" } ] } ``` | parameter | Type | Required | Default | Range / Example | Description | | ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | | `category` | string | ✅ Yes | - | `HARM_CATEGORY_HATE_SPEECH`
`HARM_CATEGORY_SEXUALLY_EXPLICIT`
`HARM_CATEGORY_DANGEROUS_CONTENT`
`HARM_CATEGORY_HARASSMENT`
`HARM_CATEGORY_CIVIC_INTEGRITY` | The harm category to apply the safety setting to. | | `threshold` | string | ✅ Yes | - | `BLOCK_ONLY_HIGH`
`BLOCK_MEDIUM_AND_ABOVE`
`BLOCK_LOW_AND_ABOVE`
`BLOCK_NONE` | The threshold for blocking content. | ### Generation Config ```json Generation configuration theme={null} { "generationConfig": { "temperature": 0.7, "topP": 0.95, "topk": 40, "maxOutputTokens": 1024, "stopSequences": ["Human:"], "response_mimeType": "text/plain" } } ``` | parameter | Type | Required | Default | Range / Example | Description | | ------------------ | ------- | -------- | ------- | ------------------------------------ | -------------------------------------- | | `temperature` | number | ❌ No | - | 0.0-1.0 | Controls the randomness of the output. | | `topP` | number | ❌ No | - | 0.0-1.0 | Nucleus sampling threshold. | | `topk` | integer | ❌ No | - | - | Top-k sampling parameter. | | `maxOutputTokens` | integer | ❌ No | - | - | Maximum number of tokens to generate. | | `stopSequences` | array | ❌ No | - | - | Sequences at which to stop generation. | | `responseMimeType` | string | ❌ No | - | `text/plain`
`application/json` | MIME type of the response. | ### Thinking Config ```json Thinking configuration gemini-2* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingBudget": 1000 } } } ``` ```json Thinking configuration gemini-3* theme={null} { "generationConfig": { "thinkingConfig": { "includeThoughts": true, "thinkingLevel": "HIGH" } } } ``` > **Note:** `thinking_level` is only supported on Gemini 3.0 and above. It cannot be used together with `thinking_budget`; doing so will return an error. | parameter | Type | Required | Default | Range / Example | Description | | --------------------------------- | ------- | -------- | ------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `thinkingConfig` | object | ❌ No | - | - | Configuration for thinking functionality. | | >`thinkingConfig.includeThoughts` | boolean | ❌ No | - | - | Indicates whether to include thoughts in the response. If true, thoughts are only returned when thinking is enabled. | | >`thinkingConfig.thinkingBudget` | integer | ❌ No | - | 0-24576 | Specifies the maximum number of tokens for generated thoughts. | | >`thinkingConfig.thinkingLevel` | enum | ❌ No | `high` | `low`
`high`
`medium`
`minimal` | Controls the maximum depth of the model's internal reasoning process before generating a response. If not specified, the default is HIGH. Recommended for Gemini 3 or newer models. Using it with older models may cause errors. | ### Image Config ```json Image configuration theme={null} { "generationConfig": { "imageConfig": { "aspectRatio": "1:1", "imageSize": "1k" } } } ``` | parameter | Type | Required | Default | Range / Example | Description | | -------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `imageConfig` | object | ❌ No | - | - | Configuration for image generation. | | >`imageConfig.aspectRatio` | string | ❌ No | - | `1:1`
`2:3`
`3:2`
`3:4`
`4:3`
`9:16`
`16:9`
`21:9` | Aspect ratio of the generated image. If not specified, the model will select the appropriate aspect ratio based on the specified content. | | >`imageConfig.imageSize` | string | ❌ No | - | `1k`
`2k`
`4k` | Approximate size of the generated image. If not specified, the model will use the default value of 1k. | ### Web Search Web Search Grounding allows Gemini models to connect with real-time web content, providing more accurate answers with verifiable sources. #### Basic Usage ```json Web Search theme={null} { "tools": [ { "google_search": {} } ] } ``` ```json Web Search with Time Range Filter theme={null} { "tools": [ { "google_search": { "timeRangeFilter": { "startTime": "2024-01-01T00:00:00Z", "endTime": "2024-01-01T12:00:00Z" } } } ] } ``` | Parameter | Type | Required | Default | Range / Example | Description | | ------------------------------------------------- | ------ | -------- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `tools` | array | ❌ No | - | - | Array of tools to use for the request. | | >`tools.googleSearch` | object | ❌ No | - | - | Configuration for Google Search Grounding. | | >>`tools.googleSearch.timeRangeFilter` | object | ❌ No | - | - | Optional time range filter for the search. | | >>>`tools.googleSearch.timeRangeFilter.startTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional start time for the search in ISO 8601 format or timestamp. | | >>>`tools.googleSearch.timeRangeFilter.endTime` | string | ❌ No | - | `2024-01-01T00:00:00Z` or timestamp | Optional end time for the search in ISO 8601 format or timestamp. Note: For Gemini 3 models, the time span cannot exceed 24 hours. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # gemini-3.5-flash (File Analysis) Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.5-flash/openai-format/file-analysis POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "what is in this file?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/gptproto.pdf" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # gemini-3.5-flash (Image To Text) Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.5-flash/openai-format/image-to-text POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is shown in this PNG image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # gemini-3.5-flash (Text To Text) Source: https://docs.gptproto.com/docs/allapi/Google/gemini-3.5-flash/openai-format/text-to-text POST https://gptproto.com/v1/chat/completions ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "gemini-3.5-flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "who are you?" } ] } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Based on the image provided, this is a technical documentation page titled **\"Authentication\"** for an API service called **GPTProto**. It guides developers on how to securely access and use the API.\n\nHere is a breakdown of the specific sections contained in the file:\n\n**1. API Key Authentication**\n* It explains that the GPTProto API uses **Bearer token authentication**.\n* All requests must include the API key in the header.\n\n**2. Getting Your API Key**\n* Provides a step-by-step guide:\n 1. Sign up at `https://gptproto.com`.\n 2. Navigate to the API Keys section in the dashboard.\n 3. Generate a new key.\n 4. Copy and store it securely.\n* **Security Warning:** It explicitly warns users to keep keys secure, not to commit them to version control, and to rotate them regularly.\n\n**3. Making Authenticated Requests**\n* Shows how to structure the HTTP header: `Authorization: Bearer YOUR_API_KEY`.\n* Provides a **cURL** code snippet demonstrating a POST request to `https://gptproto.com/v1/chat/completions` using the model \"gpt-4o\".\n\n**4. Environment Variables**\n* **Recommended Setup:** Advises storing keys in environment variables (e.g., `export GPTPROTO_API_KEY=\"...\"`) rather than hardcoding them.\n* **Using .env Files:** Shows a Python code example using `python-dotenv` to load credentials securely.\n* **Warning:** Reminds users to add `.env` files to `.gitignore` to prevent leaking secrets.\n\n**5. Authentication Errors**\n* Lists common HTTP error codes and their JSON response formats:\n * **401 Unauthorized:** Key is missing or invalid.\n * **403 Forbidden:** Key doesn't have permission for the resource.\n * **429 Too Many Requests:** Rate limit exceeded.\n\n**6. Best Practices**\n* Lists expandable sections for maintaining security, such as \"Implement Key Rotation,\" \"Use Different Keys for Different Environments,\" and \"Monitor Usage.\"\n\n**7. API Key Management**\n* **Generating New Keys:** Instructions on how to create descriptive keys via the dashboard. It notes you can only copy the key once.\n* **Revoking Keys:** Steps to revoke a compromised key and update applications.\n\n**8. Support**\n* Troubleshooting tips for authentication issues.\n* Provides a contact email for help: `jacoblam3219@gmail.com`.", "role": "assistant" } } ], "created": 1766411482, "id": "chatcmpl-****", "model": "gemini-2.5-pro", "object": "chat.completion", "usage": { "completion_tokens": 2051, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 1489, "rejected_prediction_tokens": 0 }, "prompt_tokens": 519, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 }, "total_tokens": 2570 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | -------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | ✅ Yes | - | - | Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ❌ No | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------------- | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_completion_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo-3.1-Fast-Generate-Preview - Image To Video Source: https://docs.gptproto.com/docs/allapi/Google/veo-3.1-fast-generate-preview/official-format/image-to-video POST https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning Fast veo 3.1 image to video preview. High-speed AI animation to turn any photo into a professional cinematic video clip. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning' \ --header 'x-goog-api-key: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "instances": [ { "prompt": "Generate a video of a real-life model posing for a photoshoot.", "image": { "mimeType": "image/png", "bytesBase64Encoded": "BASE64_ENCODED_IMAGE" } } ], "parameters": { "aspectRatio": "9:16" } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "instances": [ { "prompt": "Generate a video of a real-life model posing for a photoshoot.", "image": { "mimeType": "image/png", "bytesBase64Encoded": "BASE64_ENCODED_IMAGE" } } ], "parameters": { "aspectRatio": "9:16" } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning', headers: { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning" payload = json.dumps({ "instances": [ { "prompt": "Generate a video of a real-life model posing for a photoshoot.", "image": { "mimeType": "image/png", "bytesBase64Encoded": "BASE64_ENCODED_IMAGE" } } ], "parameters": { "aspectRatio": "9:16" } }) headers = { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning" method := "POST" payload := strings.NewReader(`{ "instances": [ { "prompt": "Generate a video of a real-life model posing for a photoshoot.", "image": { "mimeType": "image/png", "bytesBase64Encoded": "BASE64_ENCODED_IMAGE" } } ], "parameters": { "aspectRatio": "9:16" } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("x-goog-api-key", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result After submitting a video generation request, the API returns an operation object. Use the operation name to poll for the result. ```bash cURL theme={null} curl -X GET "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(result) ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` Query URL uses `api.gptproto.com` domain. Replace `{model}` with the model name and `{operation_id}` with the operation ID from the generation response. ```json theme={null} { "name": "models/veo-3.1-generate-preview/operations/abc123", "done": true, "response": { "generateVideoResponse": { "generatedSamples": [ { "video": { "uri": "https://api.gptproto.com/upload/v1beta/files/abc:download?alt=media", "encoding": "video/mp4" } } ] } } } ``` ## Download Video Once the operation is complete, use the video URI from the response to download the generated video. ```bash cURL theme={null} curl -L "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -o output.mp4 ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" headers = { "x-goog-api-key": "GPTPROTO_API_KEY" } response = requests.get(url, headers=headers) with open("output.mp4", "wb") as f: f.write(response.content) print("Video saved to output.mp4") ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY" }; fetch(url, { headers }) .then(response => response.blob()) .then(blob => { const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "output.mp4"; a.click(); }); ``` Replace `{file_id}` with the file ID from the video URI in the query response (e.g. `abc` from `.../files/abc:download?alt=media`). ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:predictLongRunning` | Model | Description | | ------------------------------- | ---------------------------------- | | `veo-3.1-generate-preview` | Veo 3.1 standard — highest quality | | `veo-3.1-fast-generate-preview` | Veo 3.1 Fast — optimized for speed | ### Request Body The request uses Google's Vertex AI format with `instances` and `parameters` arrays. #### instances\[0] — Core Parameters | Parameter | Type | Required | Default | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | A text description of the desired video. Supports audio cues. | | `image` | object | ❌ No | - | Source image for image-to-video generation. | | `image.mimeType` | string | ❌ No | - | MIME type of the image (e.g. `image/png`, `image/jpeg`). | | `image.bytesBase64Encoded` | string | ❌ No | - | Base64-encoded image data. | | `video` | object | ❌ No | - | Source video for video-to-video generation (editing/extension). | | `video.uri` | string | ❌ No | - | URL of the source video. | #### parameters — Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------ | ------- | -------- | ------- | ------------------------------ | --------------------------------------------------------------------------------- | | `aspectRatio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | | `durationSeconds` | string | ❌ No | - | `4, 6, 8` | Length of the generated video in seconds. Must be `8` for 1080p/4k. | | `personGeneration` | string | ❌ No | - | `allow_all`
`allow_adult` | Controls the generation of people. | | `enhancePrompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better quality. | ## Scene Comparison | Feature | text-to-video | image-to-video | video-to-video | | -------------------- | :-----------: | :------------: | :------------: | | `prompt` | ✅ Required | ✅ Required | ✅ Required | | `image` | ❌ | ✅ Required | ❌ | | `video` | ❌ | ❌ | ✅ Required | | `aspectRatio` | ✅ | ✅ | ✅ | | `resolution` | ✅ | ✅ | ✅ | | Audio cues in prompt | ✅ | ✅ | ✅ | **Notes:** * **veo-3.1-generate-preview**: Highest quality, suitable for professional content. * **veo-3.1-fast-generate-preview**: Lower latency, suitable for high-volume tasks. * **Video retention**: Generated videos are stored for 2 days. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo-3.1-Fast-Generate-Preview - Text To Video Source: https://docs.gptproto.com/docs/allapi/Google/veo-3.1-fast-generate-preview/official-format/text-to-video POST https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning Rapid veo 3.1 text to video preview. Generate high-quality cinematic videos from text prompts with record-breaking AI speed. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning' \ --header 'x-goog-api-key: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "instances": [ { "prompt": "a cat" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "instances": [ { "prompt": "a cat" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning', headers: { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning" payload = json.dumps({ "instances": [ { "prompt": "a cat" } ] }) headers = { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning" method := "POST" payload := strings.NewReader(`{ "instances": [ { "prompt": "a cat" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("x-goog-api-key", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result After submitting a video generation request, the API returns an operation object. Use the operation name to poll for the result. ```bash cURL theme={null} curl -X GET "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(result) ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` Query URL uses `api.gptproto.com` domain. Replace `{model}` with the model name and `{operation_id}` with the operation ID from the generation response. ```json theme={null} { "name": "models/veo-3.1-generate-preview/operations/abc123", "done": true, "response": { "generateVideoResponse": { "generatedSamples": [ { "video": { "uri": "https://api.gptproto.com/upload/v1beta/files/abc:download?alt=media", "encoding": "video/mp4" } } ] } } } ``` ## Download Video Once the operation is complete, use the video URI from the response to download the generated video. ```bash cURL theme={null} curl -L "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -o output.mp4 ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" headers = { "x-goog-api-key": "GPTPROTO_API_KEY" } response = requests.get(url, headers=headers) with open("output.mp4", "wb") as f: f.write(response.content) print("Video saved to output.mp4") ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY" }; fetch(url, { headers }) .then(response => response.blob()) .then(blob => { const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "output.mp4"; a.click(); }); ``` Replace `{file_id}` with the file ID from the video URI in the query response (e.g. `abc` from `.../files/abc:download?alt=media`). ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:predictLongRunning` | Model | Description | | ------------------------------- | ---------------------------------- | | `veo-3.1-generate-preview` | Veo 3.1 standard — highest quality | | `veo-3.1-fast-generate-preview` | Veo 3.1 Fast — optimized for speed | ### Request Body The request uses Google's Vertex AI format with `instances` and `parameters` arrays. #### instances\[0] — Core Parameters | Parameter | Type | Required | Default | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | A text description of the desired video. Supports audio cues. | | `image` | object | ❌ No | - | Source image for image-to-video generation. | | `image.mimeType` | string | ❌ No | - | MIME type of the image (e.g. `image/png`, `image/jpeg`). | | `image.bytesBase64Encoded` | string | ❌ No | - | Base64-encoded image data. | | `video` | object | ❌ No | - | Source video for video-to-video generation (editing/extension). | | `video.uri` | string | ❌ No | - | URL of the source video. | #### parameters — Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------ | ------- | -------- | ------- | ------------------------------ | --------------------------------------------------------------------------------- | | `aspectRatio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | | `durationSeconds` | string | ❌ No | - | `4, 6, 8` | Length of the generated video in seconds. Must be `8` for 1080p/4k. | | `personGeneration` | string | ❌ No | - | `allow_all`
`allow_adult` | Controls the generation of people. | | `enhancePrompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better quality. | ## Scene Comparison | Feature | text-to-video | image-to-video | video-to-video | | -------------------- | :-----------: | :------------: | :------------: | | `prompt` | ✅ Required | ✅ Required | ✅ Required | | `image` | ❌ | ✅ Required | ❌ | | `video` | ❌ | ❌ | ✅ Required | | `aspectRatio` | ✅ | ✅ | ✅ | | `resolution` | ✅ | ✅ | ✅ | | Audio cues in prompt | ✅ | ✅ | ✅ | **Notes:** * **veo-3.1-generate-preview**: Highest quality, suitable for professional content. * **veo-3.1-fast-generate-preview**: Lower latency, suitable for high-volume tasks. * **Video retention**: Generated videos are stored for 2 days. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo-3.1-Fast-Generate-Preview - Video To Video Source: https://docs.gptproto.com/docs/allapi/Google/veo-3.1-fast-generate-preview/official-format/video-to-video POST https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning Quick veo 3.1 video to video preview. Instantly restyle and transform existing videos with advanced AI generative effects. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning' \ --header 'x-goog-api-key: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "instances": [ { "prompt": "Replace the fox with a tiger", "video": { "uri": "https://oss.gptproto.com/ai/api1bfc42f3-af1f-4eb9-b91f-ae8fba044ac8.mp4" } } ], "parameters": { "resolution": "720p", "aspectRatio": "9:16" } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "instances": [ { "prompt": "Replace the fox with a tiger", "video": { "uri": "https://oss.gptproto.com/ai/api1bfc42f3-af1f-4eb9-b91f-ae8fba044ac8.mp4" } } ], "parameters": { "resolution": "720p", "aspectRatio": "9:16" } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning', headers: { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning" payload = json.dumps({ "instances": [ { "prompt": "Replace the fox with a tiger", "video": { "uri": "https://oss.gptproto.com/ai/api1bfc42f3-af1f-4eb9-b91f-ae8fba044ac8.mp4" } } ], "parameters": { "resolution": "720p", "aspectRatio": "9:16" } }) headers = { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning" method := "POST" payload := strings.NewReader(`{ "instances": [ { "prompt": "Replace the fox with a tiger", "video": { "uri": "https://oss.gptproto.com/ai/api1bfc42f3-af1f-4eb9-b91f-ae8fba044ac8.mp4" } } ], "parameters": { "resolution": "720p", "aspectRatio": "9:16" } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("x-goog-api-key", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result After submitting a video generation request, the API returns an operation object. Use the operation name to poll for the result. ```bash cURL theme={null} curl -X GET "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(result) ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` Query URL uses `api.gptproto.com` domain. Replace `{model}` with the model name and `{operation_id}` with the operation ID from the generation response. ```json theme={null} { "name": "models/veo-3.1-generate-preview/operations/abc123", "done": true, "response": { "generateVideoResponse": { "generatedSamples": [ { "video": { "uri": "https://api.gptproto.com/upload/v1beta/files/abc:download?alt=media", "encoding": "video/mp4" } } ] } } } ``` ## Download Video Once the operation is complete, use the video URI from the response to download the generated video. ```bash cURL theme={null} curl -L "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -o output.mp4 ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" headers = { "x-goog-api-key": "GPTPROTO_API_KEY" } response = requests.get(url, headers=headers) with open("output.mp4", "wb") as f: f.write(response.content) print("Video saved to output.mp4") ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY" }; fetch(url, { headers }) .then(response => response.blob()) .then(blob => { const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "output.mp4"; a.click(); }); ``` Replace `{file_id}` with the file ID from the video URI in the query response (e.g. `abc` from `.../files/abc:download?alt=media`). ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:predictLongRunning` | Model | Description | | ------------------------------- | ---------------------------------- | | `veo-3.1-generate-preview` | Veo 3.1 standard — highest quality | | `veo-3.1-fast-generate-preview` | Veo 3.1 Fast — optimized for speed | ### Request Body The request uses Google's Vertex AI format with `instances` and `parameters` arrays. #### instances\[0] — Core Parameters | Parameter | Type | Required | Default | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | A text description of the desired video. Supports audio cues. | | `image` | object | ❌ No | - | Source image for image-to-video generation. | | `image.mimeType` | string | ❌ No | - | MIME type of the image (e.g. `image/png`, `image/jpeg`). | | `image.bytesBase64Encoded` | string | ❌ No | - | Base64-encoded image data. | | `video` | object | ❌ No | - | Source video for video-to-video generation (editing/extension). | | `video.uri` | string | ❌ No | - | URL of the source video. | #### parameters — Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------ | ------- | -------- | ------- | ------------------------------ | --------------------------------------------------------------------------------- | | `aspectRatio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | | `durationSeconds` | string | ❌ No | - | `4, 6, 8` | Length of the generated video in seconds. Must be `8` for 1080p/4k. | | `personGeneration` | string | ❌ No | - | `allow_all`
`allow_adult` | Controls the generation of people. | | `enhancePrompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better quality. | ## Scene Comparison | Feature | text-to-video | image-to-video | video-to-video | | -------------------- | :-----------: | :------------: | :------------: | | `prompt` | ✅ Required | ✅ Required | ✅ Required | | `image` | ❌ | ✅ Required | ❌ | | `video` | ❌ | ❌ | ✅ Required | | `aspectRatio` | ✅ | ✅ | ✅ | | `resolution` | ✅ | ✅ | ✅ | | Audio cues in prompt | ✅ | ✅ | ✅ | **Notes:** * **veo-3.1-generate-preview**: Highest quality, suitable for professional content. * **veo-3.1-fast-generate-preview**: Lower latency, suitable for high-volume tasks. * **Video retention**: Generated videos are stored for 2 days. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo-3.1-Generate-Preview - Image To Video Source: https://docs.gptproto.com/docs/allapi/Google/veo-3.1-generate-preview/official-format/image-to-video POST https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning Stunning veo 3.1 image to video preview. Professional-grade AI animation for high-resolution cinematic motion from images. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning' \ --header 'x-goog-api-key: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "instances": [ { "prompt": "Generate a video of a real-life model posing for a photoshoot.", "image": { "mimeType": "image/png", "bytesBase64Encoded": "BASE64_ENCODED_IMAGE" } } ], "parameters": { "aspectRatio": "9:16" } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "instances": [ { "prompt": "Generate a video of a real-life model posing for a photoshoot.", "image": { "mimeType": "image/png", "bytesBase64Encoded": "BASE64_ENCODED_IMAGE" } } ], "parameters": { "aspectRatio": "9:16" } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning', headers: { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning" payload = json.dumps({ "instances": [ { "prompt": "Generate a video of a real-life model posing for a photoshoot.", "image": { "mimeType": "image/png", "bytesBase64Encoded": "BASE64_ENCODED_IMAGE" } } ], "parameters": { "aspectRatio": "9:16" } }) headers = { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning" method := "POST" payload := strings.NewReader(`{ "instances": [ { "prompt": "Generate a video of a real-life model posing for a photoshoot.", "image": { "mimeType": "image/png", "bytesBase64Encoded": "BASE64_ENCODED_IMAGE" } } ], "parameters": { "aspectRatio": "9:16" } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("x-goog-api-key", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result After submitting a video generation request, the API returns an operation object. Use the operation name to poll for the result. ```bash cURL theme={null} curl -X GET "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(result) ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` Query URL uses `api.gptproto.com` domain. Replace `{model}` with the model name and `{operation_id}` with the operation ID from the generation response. ```json theme={null} { "name": "models/veo-3.1-generate-preview/operations/abc123", "done": true, "response": { "generateVideoResponse": { "generatedSamples": [ { "video": { "uri": "https://api.gptproto.com/upload/v1beta/files/abc:download?alt=media", "encoding": "video/mp4" } } ] } } } ``` ## Download Video Once the operation is complete, use the video URI from the response to download the generated video. ```bash cURL theme={null} curl -L "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -o output.mp4 ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" headers = { "x-goog-api-key": "GPTPROTO_API_KEY" } response = requests.get(url, headers=headers) with open("output.mp4", "wb") as f: f.write(response.content) print("Video saved to output.mp4") ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY" }; fetch(url, { headers }) .then(response => response.blob()) .then(blob => { const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "output.mp4"; a.click(); }); ``` Replace `{file_id}` with the file ID from the video URI in the query response (e.g. `abc` from `.../files/abc:download?alt=media`). ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:predictLongRunning` | Model | Description | | ------------------------------- | ---------------------------------- | | `veo-3.1-generate-preview` | Veo 3.1 standard — highest quality | | `veo-3.1-fast-generate-preview` | Veo 3.1 Fast — optimized for speed | ### Request Body The request uses Google's Vertex AI format with `instances` and `parameters` arrays. #### instances\[0] — Core Parameters | Parameter | Type | Required | Default | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | A text description of the desired video. Supports audio cues. | | `image` | object | ❌ No | - | Source image for image-to-video generation. | | `image.mimeType` | string | ❌ No | - | MIME type of the image (e.g. `image/png`, `image/jpeg`). | | `image.bytesBase64Encoded` | string | ❌ No | - | Base64-encoded image data. | | `video` | object | ❌ No | - | Source video for video-to-video generation (editing/extension). | | `video.uri` | string | ❌ No | - | URL of the source video. | #### parameters — Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------ | ------- | -------- | ------- | ------------------------------ | --------------------------------------------------------------------------------- | | `aspectRatio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | | `durationSeconds` | string | ❌ No | - | `4, 6, 8` | Length of the generated video in seconds. Must be `8` for 1080p/4k. | | `personGeneration` | string | ❌ No | - | `allow_all`
`allow_adult` | Controls the generation of people. | | `enhancePrompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better quality. | ## Scene Comparison | Feature | text-to-video | image-to-video | video-to-video | | -------------------- | :-----------: | :------------: | :------------: | | `prompt` | ✅ Required | ✅ Required | ✅ Required | | `image` | ❌ | ✅ Required | ❌ | | `video` | ❌ | ❌ | ✅ Required | | `aspectRatio` | ✅ | ✅ | ✅ | | `resolution` | ✅ | ✅ | ✅ | | Audio cues in prompt | ✅ | ✅ | ✅ | **Notes:** * **veo-3.1-generate-preview**: Highest quality, suitable for professional content. * **veo-3.1-fast-generate-preview**: Lower latency, suitable for high-volume tasks. * **Video retention**: Generated videos are stored for 2 days. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo-3.1-Generate-Preview - Text To Video Source: https://docs.gptproto.com/docs/allapi/Google/veo-3.1-generate-preview/official-format/text-to-video POST https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning Creative veo 3.1 text to video preview. Turn descriptive text into breathtaking high-fidelity video scenes with ease. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning' \ --header 'x-goog-api-key: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "instances": [ { "prompt": "a cat" } ] }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "instances": [ { "prompt": "a cat" } ] }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning', headers: { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning" payload = json.dumps({ "instances": [ { "prompt": "a cat" } ] }) headers = { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning" method := "POST" payload := strings.NewReader(`{ "instances": [ { "prompt": "a cat" } ] }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("x-goog-api-key", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result After submitting a video generation request, the API returns an operation object. Use the operation name to poll for the result. ```bash cURL theme={null} curl -X GET "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(result) ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` Query URL uses `api.gptproto.com` domain. Replace `{model}` with the model name and `{operation_id}` with the operation ID from the generation response. ```json theme={null} { "name": "models/veo-3.1-generate-preview/operations/abc123", "done": true, "response": { "generateVideoResponse": { "generatedSamples": [ { "video": { "uri": "https://api.gptproto.com/upload/v1beta/files/abc:download?alt=media", "encoding": "video/mp4" } } ] } } } ``` ## Download Video Once the operation is complete, use the video URI from the response to download the generated video. ```bash cURL theme={null} curl -L "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -o output.mp4 ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" headers = { "x-goog-api-key": "GPTPROTO_API_KEY" } response = requests.get(url, headers=headers) with open("output.mp4", "wb") as f: f.write(response.content) print("Video saved to output.mp4") ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY" }; fetch(url, { headers }) .then(response => response.blob()) .then(blob => { const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "output.mp4"; a.click(); }); ``` Replace `{file_id}` with the file ID from the video URI in the query response (e.g. `abc` from `.../files/abc:download?alt=media`). ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:predictLongRunning` | Model | Description | | ------------------------------- | ---------------------------------- | | `veo-3.1-generate-preview` | Veo 3.1 standard — highest quality | | `veo-3.1-fast-generate-preview` | Veo 3.1 Fast — optimized for speed | ### Request Body The request uses Google's Vertex AI format with `instances` and `parameters` arrays. #### instances\[0] — Core Parameters | Parameter | Type | Required | Default | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | A text description of the desired video. Supports audio cues. | | `image` | object | ❌ No | - | Source image for image-to-video generation. | | `image.mimeType` | string | ❌ No | - | MIME type of the image (e.g. `image/png`, `image/jpeg`). | | `image.bytesBase64Encoded` | string | ❌ No | - | Base64-encoded image data. | | `video` | object | ❌ No | - | Source video for video-to-video generation (editing/extension). | | `video.uri` | string | ❌ No | - | URL of the source video. | #### parameters — Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------ | ------- | -------- | ------- | ------------------------------ | --------------------------------------------------------------------------------- | | `aspectRatio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | | `durationSeconds` | string | ❌ No | - | `4, 6, 8` | Length of the generated video in seconds. Must be `8` for 1080p/4k. | | `personGeneration` | string | ❌ No | - | `allow_all`
`allow_adult` | Controls the generation of people. | | `enhancePrompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better quality. | ## Scene Comparison | Feature | text-to-video | image-to-video | video-to-video | | -------------------- | :-----------: | :------------: | :------------: | | `prompt` | ✅ Required | ✅ Required | ✅ Required | | `image` | ❌ | ✅ Required | ❌ | | `video` | ❌ | ❌ | ✅ Required | | `aspectRatio` | ✅ | ✅ | ✅ | | `resolution` | ✅ | ✅ | ✅ | | Audio cues in prompt | ✅ | ✅ | ✅ | **Notes:** * **veo-3.1-generate-preview**: Highest quality, suitable for professional content. * **veo-3.1-fast-generate-preview**: Lower latency, suitable for high-volume tasks. * **Video retention**: Generated videos are stored for 2 days. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo-3.1-Generate-Preview - Video To Video Source: https://docs.gptproto.com/docs/allapi/Google/veo-3.1-generate-preview/official-format/video-to-video POST https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning Elite veo 3.1 video to video preview. Sophisticated AI video editing and restyling for professional cinematic production. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning' \ --header 'x-goog-api-key: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "instances": [ { "prompt": "Replace the fox with a tiger", "video": { "uri": "https://oss.gptproto.com/ai/api1bfc42f3-af1f-4eb9-b91f-ae8fba044ac8.mp4" } } ], "parameters": { "resolution": "720p", "aspectRatio": "9:16" } }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "instances": [ { "prompt": "Replace the fox with a tiger", "video": { "uri": "https://oss.gptproto.com/ai/api1bfc42f3-af1f-4eb9-b91f-ae8fba044ac8.mp4" } } ], "parameters": { "resolution": "720p", "aspectRatio": "9:16" } }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning', headers: { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning" payload = json.dumps({ "instances": [ { "prompt": "Replace the fox with a tiger", "video": { "uri": "https://oss.gptproto.com/ai/api1bfc42f3-af1f-4eb9-b91f-ae8fba044ac8.mp4" } } ], "parameters": { "resolution": "720p", "aspectRatio": "9:16" } }) headers = { 'x-goog-api-key': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning" method := "POST" payload := strings.NewReader(`{ "instances": [ { "prompt": "Replace the fox with a tiger", "video": { "uri": "https://oss.gptproto.com/ai/api1bfc42f3-af1f-4eb9-b91f-ae8fba044ac8.mp4" } } ], "parameters": { "resolution": "720p", "aspectRatio": "9:16" } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("x-goog-api-key", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result After submitting a video generation request, the API returns an operation object. Use the operation name to poll for the result. ```bash cURL theme={null} curl -X GET "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(result) ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` Query URL uses `api.gptproto.com` domain. Replace `{model}` with the model name and `{operation_id}` with the operation ID from the generation response. ```json theme={null} { "name": "models/veo-3.1-generate-preview/operations/abc123", "done": true, "response": { "generateVideoResponse": { "generatedSamples": [ { "video": { "uri": "https://api.gptproto.com/upload/v1beta/files/abc:download?alt=media", "encoding": "video/mp4" } } ] } } } ``` ## Download Video Once the operation is complete, use the video URI from the response to download the generated video. ```bash cURL theme={null} curl -L "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" \ -H "x-goog-api-key: GPTPROTO_API_KEY" \ -o output.mp4 ``` ```python Python theme={null} import requests url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" headers = { "x-goog-api-key": "GPTPROTO_API_KEY" } response = requests.get(url, headers=headers) with open("output.mp4", "wb") as f: f.write(response.content) print("Video saved to output.mp4") ``` ```javascript JavaScript theme={null} const url = "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media"; const headers = { "x-goog-api-key": "GPTPROTO_API_KEY" }; fetch(url, { headers }) .then(response => response.blob()) .then(blob => { const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "output.mp4"; a.click(); }); ``` Replace `{file_id}` with the file ID from the video URI in the query response (e.g. `abc` from `.../files/abc:download?alt=media`). ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/v1beta/models/{model}:predictLongRunning` | Model | Description | | ------------------------------- | ---------------------------------- | | `veo-3.1-generate-preview` | Veo 3.1 standard — highest quality | | `veo-3.1-fast-generate-preview` | Veo 3.1 Fast — optimized for speed | ### Request Body The request uses Google's Vertex AI format with `instances` and `parameters` arrays. #### instances\[0] — Core Parameters | Parameter | Type | Required | Default | Description | | -------------------------- | ------ | -------- | ------- | --------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | A text description of the desired video. Supports audio cues. | | `image` | object | ❌ No | - | Source image for image-to-video generation. | | `image.mimeType` | string | ❌ No | - | MIME type of the image (e.g. `image/png`, `image/jpeg`). | | `image.bytesBase64Encoded` | string | ❌ No | - | Base64-encoded image data. | | `video` | object | ❌ No | - | Source video for video-to-video generation (editing/extension). | | `video.uri` | string | ❌ No | - | URL of the source video. | #### parameters — Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------ | ------- | -------- | ------- | ------------------------------ | --------------------------------------------------------------------------------- | | `aspectRatio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | | `durationSeconds` | string | ❌ No | - | `4, 6, 8` | Length of the generated video in seconds. Must be `8` for 1080p/4k. | | `personGeneration` | string | ❌ No | - | `allow_all`
`allow_adult` | Controls the generation of people. | | `enhancePrompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better quality. | ## Scene Comparison | Feature | text-to-video | image-to-video | video-to-video | | -------------------- | :-----------: | :------------: | :------------: | | `prompt` | ✅ Required | ✅ Required | ✅ Required | | `image` | ❌ | ✅ Required | ❌ | | `video` | ❌ | ❌ | ✅ Required | | `aspectRatio` | ✅ | ✅ | ✅ | | `resolution` | ✅ | ✅ | ✅ | | Audio cues in prompt | ✅ | ✅ | ✅ | **Notes:** * **veo-3.1-generate-preview**: Highest quality, suitable for professional content. * **veo-3.1-fast-generate-preview**: Lower latency, suitable for high-volume tasks. * **Video retention**: Generated videos are stored for 2 days. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3-Fast - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3-fast/gptproto-format/image-to-video POST https://gptproto.com/api/v3/google/veo3-fast/image-to-video High-speed veo3 fast image to video. Quickly animate your photos into high-quality video content with efficient AI motion. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3-fast/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3-fast/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3-fast/image-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3-fast/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3-Fast - Reference To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3-fast/gptproto-format/reference-to-video POST https://gptproto.com/api/v3/google/veo3-fast/reference-to-video Rapid veo3 fast reference to video. Create new video content based on your style or character references with lightning speed. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3-fast/reference-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3-fast/reference-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3-fast/reference-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3-fast/reference-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3-Fast - Text To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3-fast/gptproto-format/text-to-video POST https://gptproto.com/api/v3/google/veo3-fast/text-to-video Instant veo3 fast text to video. Generate cinematic AI videos from text prompts quickly and efficiently for any project. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3-fast/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3-fast/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3-fast/text-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3-fast/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3-Pro - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3-pro/gptproto-format/image-to-video POST https://gptproto.com/api/v3/google/veo3-pro/image-to-video Professional veo3 pro image to video. Master-level AI animation for high-resolution cinematic video creation from still shots. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3-pro/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3-pro/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3-pro/image-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3-pro/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3-Pro - Text To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3-pro/gptproto-format/text-to-video POST https://gptproto.com/api/v3/google/veo3-pro/text-to-video Elite veo3 pro text to video. Premium cinematic generation with superior visual quality and complex motion for filmmakers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3-pro/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3-pro/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3-pro/text-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3-pro/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3.1-Fast - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3.1-fast/gptproto-format/image-to-video POST https://gptproto.com/api/v3/google/veo3.1-fast/image-to-video Swift veo3.1 fast image to video. Optimized AI animation for turning images into professional video clips at high speeds. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3.1-fast/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3.1-fast/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3.1-fast/image-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3.1-fast/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3.1-Fast - Reference To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3.1-fast/gptproto-format/reference-to-video POST https://gptproto.com/api/v3/google/veo3.1-fast/reference-to-video Quick veo3.1 fast reference to video. Maintain style and character consistency across AI videos with rapid generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3.1-fast/reference-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3.1-fast/reference-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3.1-fast/reference-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3.1-fast/reference-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3.1-Fast - Text To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3.1-fast/gptproto-format/text-to-video POST https://gptproto.com/api/v3/google/veo3.1-fast/text-to-video Speedy veo3.1 fast text to video. Generate high-fidelity cinematic videos from text prompts with next-gen AI efficiency. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3.1-fast/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3.1-fast/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3.1-fast/text-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3.1-fast/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3.1-Pro - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3.1-pro/gptproto-format/image-to-video POST https://gptproto.com/api/v3/google/veo3.1-pro/image-to-video Expert veo3.1 pro image to video. State-of-the-art AI animation for premium cinematic results and high-detail motion. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3.1-pro/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3.1-pro/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3.1-pro/image-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3.1-pro/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3.1-Pro - Text To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3.1-pro/gptproto-format/text-to-video POST https://gptproto.com/api/v3/google/veo3.1-pro/text-to-video Supreme veo3.1 pro text to video. The highest quality AI video generation for professional cinema and high-end advertising. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3.1-pro/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3.1-pro/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3.1-pro/text-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3.1-pro/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3.1 - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3.1/gptproto-format/image-to-video POST https://gptproto.com/api/v3/google/veo3.1/image-to-video High-quality veo3.1 image to video. Transform photos into cinematic motion with balanced speed and professional AI fidelity. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3.1/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3.1/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3.1/image-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3.1/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3.1 - Reference To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3.1/gptproto-format/reference-to-video POST https://gptproto.com/api/v3/google/veo3.1/reference-to-video Consistent veo3.1 reference to video. Use images to guide your video generation for perfect style and character matching. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3.1/reference-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3.1/reference-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3.1/reference-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3.1/reference-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3.1 - Text To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3.1/gptproto-format/text-to-video POST https://gptproto.com/api/v3/google/veo3.1/text-to-video Creative veo3.1 text to video. Produce stunning, realistic video content from text descriptions with advanced AI control. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3.1/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3.1/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3.1/text-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3.1/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3 - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3/gptproto-format/image-to-video POST https://gptproto.com/api/v3/google/veo3/image-to-video Cinematic veo3 image to video. Turn still photography into dynamic, high-resolution video scenes with advanced AI animation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3/image-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "image": "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3 - Reference To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3/gptproto-format/reference-to-video POST https://gptproto.com/api/v3/google/veo3/reference-to-video Advanced veo3 reference to video. Guide your AI video creation with visual references for consistent branding and style. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3/reference-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3/reference-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3/reference-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3/reference-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "images": [ "https://oss.gptproto.com/2025/11/12/d5c2f08479b9452aacbcf9963631ce21.jpeg" ], "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Veo3 - Text To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Google/veo3/gptproto-format/text-to-video POST https://gptproto.com/api/v3/google/veo3/text-to-video Professional veo3 text to video. High-fidelity AI video generation for creators needing cinematic quality and creative freedom. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/google/veo3/text-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/google/veo3/text-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/google/veo3/text-to-video" payload = json.dumps({ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": True }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/google/veo3/text-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "A young woman walks alone under a transparent umbrella in a quiet alley during light rain, soft city lights reflecting on the wet pavement. Her pace is calm and thoughtful. The camera follows slowly behind her, occasional droplets hitting the lens. Subtle piano music plays, evoking a melancholic but peaceful mood. Dreamy, cinematic, slightly slow motion.", "aspect_ratio": "16:9", "enhance_prompt": true }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters ### Path Parameters Endpoint: `https://gptproto.com/api/v3/google/{model}/{scene}` Body parameters may vary depending on the scene. Incorrect scene selection may cause parameters to fail. Please choose the appropriate scene based on your actual needs. | scene | example | Available Models | | -------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | | `text-to-video` | `https://gptproto.com/api/v3/google/{model}/text-to-video` | All models | | `image-to-video` | `https://gptproto.com/api/v3/google/{model}/image-to-video` | All models | | `reference-to-video` | `https://gptproto.com/api/v3/google/{model}/reference-to-video` | `veo3` `veo3-fast` `veo3.1` `veo3.1-fast` (not supported by pro models) | ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------ | -------- | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | A text description of the desired video. Supports audio cues for Veo 3 and later. | | `image` | string | ❌ No | - | - | Source image URL for image-to-video generation. | | `images` | array | ❌ No | - | 1\~3 items | Array of reference image URLs for reference-to-video generation. Not supported by pro models. | | `last_image` | string | ❌ No | - | - | The last frame image URL for interpolation video generation. Must be used in combination with the `image` parameter. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9`
`9:16` | The aspect ratio of the generated video. | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | ------- | -------- | ------- | ----------------------------- | --------------------------------------------------------------------------------- | | `enhance_prompt` | boolean | ❌ No | `true` | `true, false` | Whether to enhance the prompt for better video quality. | | `enable_upsample` | boolean | ❌ No | - | `true, false` | Whether to enable upsampling for higher resolution output. | | `resolution` | string | ❌ No | `720p` | `720p`
`1080p`
`4k` | The resolution of the generated video. `1080p` and `4k` only support 8s duration. | ## Model Comparison | Feature | Veo 3.1 / Veo 3.1 Fast | Veo 3.1 Pro | Veo 3 / Veo 3 Fast | Veo 3 Pro | | -------------------- | ---------------------- | --------------- | ------------------ | --------------- | | text-to-video | ✅ | ✅ | ✅ | ✅ | | image-to-video | ✅ | ✅ | ✅ | ✅ | | reference-to-video | ✅ | ❌ | ✅ | ❌ | | Audio cues in prompt | ✅ | ✅ | ✅ | ✅ | | Resolution | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | 720p, 1080p, 4k | | Aspect ratios | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | 16:9, 9:16 | **Notes:** * **Fast models** (`veo3-fast`, `veo3.1-fast`): Optimized for speed with lower latency, suitable for high-volume generation tasks. * **Pro models** (`veo3-pro`, `veo3.1-pro`): Higher quality output with enhanced detail and coherence. Does not support reference-to-video. * **1080p / 4k resolution**: Only available with 8-second duration. * **Video retention**: Generated videos are stored on the server for 2 days, after which they are removed. * **Watermarking**: Videos are watermarked using Google SynthID. ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-2-Image - Text To Image - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-2-image/openai-format/text-to-image POST https://gptproto.com/v1/images/generations Grok 2 image text to image generation. Create bold, creative, and high-quality AI visuals with a unique edge from your prompts. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-2-image", "prompt": "a cat.", "n": 1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-2-image", "prompt": "a cat.", "n": 1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/images/generations" payload = json.dumps({ "model": "grok-2-image", "prompt": "a cat.", "n": 1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "grok-2-image", "prompt": "a cat.", "n": 1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "data": [ { "url": "https://imgen.x.ai/xai-imgen/xai-tmp-imgen-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.jpeg", "revised_prompt": "a photograph of a cat wearing a hat, sitting on a wooden surface with a neutral expression. The cat has a mix of gray and white fur, with its front paws resting on the hat, which has a wide brim and a dark color, possibly black or dark gray. The background features a blurred indoor setting with a wooden wall and a hint of a window with natural light filtering through. The lighting is soft and natural, suggesting an indoor environment with ample sunlight. The cat's expression is neutral, with its eyes looking directly at the camera, and its ears are pointed upwards. The hat appears to be made of a soft material, possibly felt, and it covers the top of the cat's head while leaving its face visible. The image has a shallow depth of field, focusing sharply on the cat and the hat while blurring the background. There are no texts visible in the image. The cat's posture is relaxed, with its body slightly turned to the side and its tail not visible in the frame. The overall composition is balanced, with the cat and hat as the central elements, and the background includes a wooden structure that could be part of furniture or a wall." } ] } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | -------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model to be used. | | `prompt` | string | ✅ Yes | - | - | Prompt for image generation. | | `image` | string or file | ❌ No | - | - | base64-encoded data string of the picture or a public URL. | | `n` | integer | ❌ No | `1` | `1-10` | The number of images to generate. Must be between 1 and 10. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`3:4`
`4:3`
`9:16`
`16:9`
`2:3`
`3:2`
`9:19.5`
`19.5:9`
`9:20`
`20:9`
`1:2`
`2:1`
`auto` | Aspect ratio of the generated image. Only supported by grok-imagine models. | | `response_format` | string | ❌ No | `url` | `b64_json`
`url` | Response format to return the image in. Can be url or b64\_json. If b64\_json is specified, the image will be returned as a base64-encoded string instead of a url to the generated image file. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-3-Deepersearch-R - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-3-deepersearch-r/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Grok 3 deepersearch r chat. Extreme research capability with deep reasoning for the most complex investigative text tasks. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-3-deepersearch-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-3-deepersearch-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-3-deepersearch-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-3-deepersearch-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-3-Deepersearch - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-3-deepersearch/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Advanced grok 3 deepersearch chat. Professional-grade internet research and text generation for detailed, cited information. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-3-deepersearch", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-3-deepersearch", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-3-deepersearch", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-3-deepersearch", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-3-Deepsearch-R - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-3-deepsearch-r/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Grok 3 deepsearch r chat. Enhanced reasoning meets comprehensive web research for insightful, logic-driven AI conversations. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-3-deepsearch-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-3-deepsearch-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-3-deepsearch-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-3-deepsearch-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-3-Deepsearch - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-3-deepsearch/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Smart grok 3 deepsearch chat. Power your conversations with real-time web knowledge and high-fidelity text to text generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-3-deepsearch", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-3-deepsearch", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-3-deepsearch", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-3-deepsearch", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-3-Mini - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-3-mini/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Fast grok 3 mini chat. Lightweight and witty text generation for quick answers, coding help, and daily AI interactions. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-3-mini", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-3-mini", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-3-mini", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-3-mini", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-3-Reasoner-R - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-3-reasoner-r/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Grok 3 reasoner r chat. High-IQ logical processing for complex problem-solving and nuanced technical text generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-3-reasoner-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-3-reasoner-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-3-reasoner-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-3-reasoner-r", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-3-Reasoner - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-3-reasoner/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Intelligent grok 3 reasoner chat. Advanced logical chains for superior reasoning in coding, math, and professional dialogue. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-3-reasoner", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-3-reasoner", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-3-reasoner", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-3-reasoner", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-3 - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-3/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Grok 3 chat. Experience the flagship AI with exceptional intelligence, humor, and real-time knowledge for any text task. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-3", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-3", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-3", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-3", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-4-0709 - Image To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-4-0709/openai-format/image-to-text-chat POST https://gptproto.com/v1/chat/completions Grok 4 image to text chat. Next-gen visual understanding for detailed photo analysis and interactive image discussions. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-4-0709", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-4-0709", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-4-0709", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-4-0709", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-4-0709 - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-4-0709/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Supreme grok 4 chat. State-of-the-art text generation with elite reasoning and real-time awareness for professional users. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-4-0709", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-4-0709", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-4-0709", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-4-0709", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-4-1-Fast-Non-Reasoning - Image To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-4-1-fast-non-reasoning/openai-format/image-to-text-chat POST https://gptproto.com/v1/chat/completions Rapid grok 4.1 fast image to text chat. High-speed visual recognition and descriptions for quick interactive photo tasks. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-4-1-fast-non-reasoning", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-4-1-fast-non-reasoning", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-4-1-fast-non-reasoning", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-4-1-fast-non-reasoning", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-4-1-Fast-Non-Reasoning - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-4-1-fast-non-reasoning/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Instant grok 4.1 fast text chat. Optimized for speed and efficiency in everyday AI conversations and content generation. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-4-1-fast-non-reasoning", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-4-1-fast-non-reasoning", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-4-1-fast-non-reasoning", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-4-1-fast-non-reasoning", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-4-1-Fast-Reasoning - Image To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-4-1-fast-reasoning/openai-format/image-to-text-chat POST https://gptproto.com/v1/chat/completions Smart grok 4.1 fast image to text chat. Fast visual analysis combined with logical reasoning for better photo insights. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-4-1-fast-reasoning", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-4-1-fast-reasoning", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-4-1-fast-reasoning", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-4-1-fast-reasoning", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-4-1-Fast-Reasoning - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-4-1-fast-reasoning/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Quick grok 4.1 fast reasoning chat. The perfect mix of speed and logic for efficient problem-solving and intelligent text. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-4-1-fast-reasoning", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-4-1-fast-reasoning", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-4-1-fast-reasoning", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-4-1-fast-reasoning", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-4-Image - Text To Image - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-4-image/openai-format/text-to-image POST https://gptproto.com/v1/images/generations Grok 4 image text to image. Create breathtaking, high-resolution AI art with unmatched prompt adherence and creativity. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-4-image", "prompt": "a cat.", "n": 1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-4-image", "prompt": "a cat.", "n": 1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/images/generations" payload = json.dumps({ "model": "grok-4-image", "prompt": "a cat.", "n": 1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "grok-4-image", "prompt": "a cat.", "n": 1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "data": [ { "url": "https://imgen.x.ai/xai-imgen/xai-tmp-imgen-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.jpeg", "revised_prompt": "a photograph of a cat wearing a hat, sitting on a wooden surface with a neutral expression. The cat has a mix of gray and white fur, with its front paws resting on the hat, which has a wide brim and a dark color, possibly black or dark gray. The background features a blurred indoor setting with a wooden wall and a hint of a window with natural light filtering through. The lighting is soft and natural, suggesting an indoor environment with ample sunlight. The cat's expression is neutral, with its eyes looking directly at the camera, and its ears are pointed upwards. The hat appears to be made of a soft material, possibly felt, and it covers the top of the cat's head while leaving its face visible. The image has a shallow depth of field, focusing sharply on the cat and the hat while blurring the background. There are no texts visible in the image. The cat's posture is relaxed, with its body slightly turned to the side and its tail not visible in the frame. The overall composition is balanced, with the cat and hat as the central elements, and the background includes a wooden structure that could be part of furniture or a wall." } ] } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | -------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model to be used. | | `prompt` | string | ✅ Yes | - | - | Prompt for image generation. | | `image` | string or file | ❌ No | - | - | base64-encoded data string of the picture or a public URL. | | `n` | integer | ❌ No | `1` | `1-10` | The number of images to generate. Must be between 1 and 10. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`3:4`
`4:3`
`9:16`
`16:9`
`2:3`
`3:2`
`9:19.5`
`19.5:9`
`9:20`
`20:9`
`1:2`
`2:1`
`auto` | Aspect ratio of the generated image. Only supported by grok-imagine models. | | `response_format` | string | ❌ No | `url` | `b64_json`
`url` | Response format to return the image in. Can be url or b64\_json. If b64\_json is specified, the image will be returned as a base64-encoded string instead of a url to the generated image file. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-4 - Image To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-4/openai-format/image-to-text-chat POST https://gptproto.com/v1/chat/completions Elite grok 4 image to text chat. Advanced AI vision for complex visual interpretation and insightful interactive dialogue. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "https://tos.gptproto.com/resource/cat.png" } } ] } ], "max_tokens": 300 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-4 - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-4/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Next-level grok 4 chat. Experience the pinnacle of AI intelligence for sophisticated writing, coding, and real-time research. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-4", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-4", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-4", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-4", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-Code-Fast-1 - Text To Text - Chat - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-code-fast-1/openai-format/text-to-text-chat POST https://gptproto.com/v1/chat/completions Specialized grok code fast 1 chat. Rapid-fire programming assistance and high-speed technical drafting for developers. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/chat/completions' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-code-fast-1", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-code-fast-1", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/chat/completions', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/chat/completions" payload = json.dumps({ "model": "grok-code-fast-1", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": False }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/chat/completions" method := "POST" payload := strings.NewReader(`{ "model": "grok-code-fast-1", "messages": [ { "role": "user", "content": "Who are you?" } ], "stream": false }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "I'm Grok, a helpful and maximally truthful AI built by xAI. I'm designed to answer questions, provide information, and tackle problems with a bit of wit and wisdom—think of me as inspired by the Hitchhiker's Guide to the Galaxy and JARVIS from Iron Man. Not omniscient, but I'll do my best. What's on your mind?", "role": "assistant" } } ], "created": 1770018847, "id": "abc", "model": "grok-4", "object": "chat.completion", "system_fingerprint": "fp_dd0aa291c6", "usage": { "completion_tokens": 196, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 124, "rejected_prediction_tokens": 0 }, "prompt_tokens": 688, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 679 }, "total_tokens": 884 } } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ---------------------------------- | -------------- | ----------------------------- | ------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model ID used to generate the completion. Grok offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. | | `messages` | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. | | `>messages.role` | string | ✅ Yes | - | `developer`
`user`
`system` | The role of the messages author. | | `>messages.name` | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. | | `>messages.content` | string / array | ✅ Yes | - | - | The contents of the developer message. | | `>>messages.content.type` | string | ✅ Yes | - | `text`
`image_url` | The type of the content part | | `>>messages.content.text` | string | ❌ No | - | - | The text content | | `>>messages.content.image_url` | object | ✅ Yes(if type is `image_url`) | - | - | The image URL content | | `>>messages.content.image_url.url` | string | ❌ No | - | - | The URL of the image | ### Advanced Parameters | Parameter | Type | Required | Default | Range | Description | | ------------ | -------------- | -------- | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `max_tokens` | integer / null | ❌ No | - | - | An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. | | `stream` | boolean | ❌ No | `false` | `true`
`false` | Whether to stream the response back incrementally. Defaults to false. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-Imagine-Image - Image Edit - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-imagine-image/openai-format/image-edit POST https://gptproto.com/v1/images/edits Creative grok imagine image edit. Fun and powerful AI tools for artistic photo modification and visual transformations. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/edits' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-imagine-image", "image": "https://tos.gptproto.com/resource/cat.png", "prompt": "Put a hat on the cat" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-imagine-image", "image": "https://tos.gptproto.com/resource/cat.png", "prompt": "Put a hat on the cat" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/edits', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/images/edits" payload = json.dumps({ "model": "grok-imagine-image", "image": "https://tos.gptproto.com/resource/cat.png", "prompt": "Put a hat on the cat" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/edits" method := "POST" payload := strings.NewReader(`{ "model": "grok-imagine-image", "image": "https://tos.gptproto.com/resource/cat.png", "prompt": "Put a hat on the cat" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "data": [ { "url": "https://imgen.x.ai/xai-imgen/xai-tmp-imgen-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.jpeg", "revised_prompt": "a photograph of a cat wearing a hat, sitting on a wooden surface with a neutral expression. The cat has a mix of gray and white fur, with its front paws resting on the hat, which has a wide brim and a dark color, possibly black or dark gray. The background features a blurred indoor setting with a wooden wall and a hint of a window with natural light filtering through. The lighting is soft and natural, suggesting an indoor environment with ample sunlight. The cat's expression is neutral, with its eyes looking directly at the camera, and its ears are pointed upwards. The hat appears to be made of a soft material, possibly felt, and it covers the top of the cat's head while leaving its face visible. The image has a shallow depth of field, focusing sharply on the cat and the hat while blurring the background. There are no texts visible in the image. The cat's posture is relaxed, with its body slightly turned to the side and its tail not visible in the frame. The overall composition is balanced, with the cat and hat as the central elements, and the background includes a wooden structure that could be part of furniture or a wall." } ] } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | -------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model to be used. | | `prompt` | string | ✅ Yes | - | - | Prompt for image generation. | | `image` | string or file | ❌ No | - | - | base64-encoded data string of the picture or a public URL. | | `n` | integer | ❌ No | `1` | `1-10` | The number of images to generate. Must be between 1 and 10. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`3:4`
`4:3`
`9:16`
`16:9`
`2:3`
`3:2`
`9:19.5`
`19.5:9`
`9:20`
`20:9`
`1:2`
`2:1`
`auto` | Aspect ratio of the generated image. Only supported by grok-imagine models. | | `response_format` | string | ❌ No | `url` | `b64_json`
`url` | Response format to return the image in. Can be url or b64\_json. If b64\_json is specified, the image will be returned as a base64-encoded string instead of a url to the generated image file. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Grok-Imagine-Image - Text To Image - openai Source: https://docs.gptproto.com/docs/allapi/Grok/grok-imagine-image/openai-format/text-to-image POST https://gptproto.com/v1/images/generations Stunning grok imagine image text to image. Turn wild ideas into vivid AI art with bold styles and high-resolution detail. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/v1/images/generations' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "model": "grok-imagine-image", "prompt": "a cat.", "n": 1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "model": "grok-imagine-image", "prompt": "a cat.", "n": 1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/v1/images/generations', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/v1/images/generations" payload = json.dumps({ "model": "grok-imagine-image", "prompt": "a cat.", "n": 1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/v1/images/generations" method := "POST" payload := strings.NewReader(`{ "model": "grok-imagine-image", "prompt": "a cat.", "n": 1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```json theme={null} { "data": [ { "url": "https://imgen.x.ai/xai-imgen/xai-tmp-imgen-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.jpeg", "revised_prompt": "a photograph of a cat wearing a hat, sitting on a wooden surface with a neutral expression. The cat has a mix of gray and white fur, with its front paws resting on the hat, which has a wide brim and a dark color, possibly black or dark gray. The background features a blurred indoor setting with a wooden wall and a hint of a window with natural light filtering through. The lighting is soft and natural, suggesting an indoor environment with ample sunlight. The cat's expression is neutral, with its eyes looking directly at the camera, and its ears are pointed upwards. The hat appears to be made of a soft material, possibly felt, and it covers the top of the cat's head while leaving its face visible. The image has a shallow depth of field, focusing sharply on the cat and the hat while blurring the background. There are no texts visible in the image. The cat's posture is relaxed, with its body slightly turned to the side and its tail not visible in the frame. The overall composition is balanced, with the cat and hat as the central elements, and the background includes a wooden structure that could be part of furniture or a wall." } ] } ``` ## Parameters ### Core Parameters | Parameter | Type | Required | Default | Range | Description | | ----------------- | -------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | ✅ Yes | - | - | Model to be used. | | `prompt` | string | ✅ Yes | - | - | Prompt for image generation. | | `image` | string or file | ❌ No | - | - | base64-encoded data string of the picture or a public URL. | | `n` | integer | ❌ No | `1` | `1-10` | The number of images to generate. Must be between 1 and 10. | | `aspect_ratio` | string | ❌ No | `1:1` | `1:1`
`3:4`
`4:3`
`9:16`
`16:9`
`2:3`
`3:2`
`9:19.5`
`19.5:9`
`9:20`
`20:9`
`1:2`
`2:1`
`auto` | Aspect ratio of the generated image. Only supported by grok-imagine models. | | `response_format` | string | ❌ No | `url` | `b64_json`
`url` | Response format to return the image in. Can be url or b64\_json. If b64\_json is specified, the image will be returned as a base64-encoded string instead of a url to the generated image file. | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Kling-Image-O1 - Image To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Kling/kling-image-o1/gptproto-format/image-to-image POST https://gptproto.com/api/v3/kwaivgi/kling-image-o1/image-to-image Pro kling image o1 image to image. Advanced style transfer and visual modification for high-fidelity creative projects. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/kwaivgi/kling-image-o1/image-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "negative_prompt": "", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "resolution": "1k", "n": 1 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "negative_prompt": "", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "resolution": "1k", "n": 1 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/kwaivgi/kling-image-o1/image-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/kwaivgi/kling-image-o1/image-to-image" payload = json.dumps({ "prompt": "Put a hat on the cat", "negative_prompt": "", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "resolution": "1k", "n": 1 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/kwaivgi/kling-image-o1/image-to-image" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "negative_prompt": "", "images": [ "https://tos.gptproto.com/resource/cat.png" ], "resolution": "1k", "n": 1 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------- | -------- | ------- | ------------------------------------------------ | -------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 2:1, auto` | The aspect ratio of the generated image. | | `n` | integer | ❌ No | `1` | `1-9` | The number of images to generate. | | `resolution` | string | ❌ No | `1k` | `1k, 2k` | Image generation resolution. | | `images` | array | ❌ No | - | - | Including reference images of the element, scene, style, etc. Max 10 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Kling-Image-O1 - Text To Image - gptproto Source: https://docs.gptproto.com/docs/allapi/Kling/kling-image-o1/gptproto-format/text-to-image POST https://gptproto.com/api/v3/kwaivgi/kling-image-o1/text-to-image Superior kling image o1 text to image. Generate breathtakingly artistic and realistic visuals with elite AI precision. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/kwaivgi/kling-image-o1/text-to-image' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "a cat", "resolution": "1k", "n": 1, "aspect_ratio": "16:9" }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "a cat", "resolution": "1k", "n": 1, "aspect_ratio": "16:9" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/kwaivgi/kling-image-o1/text-to-image', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/kwaivgi/kling-image-o1/text-to-image" payload = json.dumps({ "prompt": "a cat", "resolution": "1k", "n": 1, "aspect_ratio": "16:9" }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/kwaivgi/kling-image-o1/text-to-image" method := "POST" payload := strings.NewReader(`{ "prompt": "a cat", "resolution": "1k", "n": 1, "aspect_ratio": "16:9" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | -------------- | ------- | -------- | ------- | ------------------------------------------------ | -------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 2:1, auto` | The aspect ratio of the generated image. | | `n` | integer | ❌ No | `1` | `1-9` | The number of images to generate. | | `resolution` | string | ❌ No | `1k` | `1k, 2k` | Image generation resolution. | | `images` | array | ❌ No | - | - | Including reference images of the element, scene, style, etc. Max 10 | ## Error Codes ### Common Error Codes | Error Code | Error Name | Description | | ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 401 | Unauthorized | API key is missing or invalid | | 403 | Forbidden | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation | | 429 | Too Many Requests | You've exceeded your rate limit | | 500 | Internal server error | An internal server error occurred | | 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) | # Kling-V2.1-Master - Image To Video - gptproto Source: https://docs.gptproto.com/docs/allapi/Kling/kling-v2.1-master/gptproto-format/image-to-video POST https://gptproto.com/api/v3/kwaivgi/kling-v2.1-master/image-to-video Master kling v2.1 image to video. Professional cinematic animation for high-detail video clips from your favorite shots. ## Authentication 1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com) 2. Navigate to the API Keys section in your dashboard 3. Generate a new API key (sk-xxxxx) 4. Copy and securely store your API key For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section. ## Initiate Request ```bash cURL theme={null} curl --location 'https://gptproto.com/api/v3/kwaivgi/kling-v2.1-master/image-to-video' \ --header 'Authorization: GPTPROTO_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Put a hat on the cat", "image": "https://tos.gptproto.com/resource/cat.png", "negative_prompt": "", "duration": 5 }' ``` ```javascript JavaScript theme={null} const axios = require('axios'); let data = JSON.stringify({ "prompt": "Put a hat on the cat", "image": "https://tos.gptproto.com/resource/cat.png", "negative_prompt": "", "duration": 5 }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://gptproto.com/api/v3/kwaivgi/kling-v2.1-master/image-to-video', headers: { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/kwaivgi/kling-v2.1-master/image-to-video" payload = json.dumps({ "prompt": "Put a hat on the cat", "image": "https://tos.gptproto.com/resource/cat.png", "negative_prompt": "", "duration": 5 }) headers = { 'Authorization': 'GPTPROTO_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go Go theme={null} package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://gptproto.com/api/v3/kwaivgi/kling-v2.1-master/image-to-video" method := "POST" payload := strings.NewReader(`{ "prompt": "Put a hat on the cat", "image": "https://tos.gptproto.com/resource/cat.png", "negative_prompt": "", "duration": 5 }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "GPTPROTO_API_KEY") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ## Query Result If the request that generated your content includes the parameter `enable_sync_mode` set to `true` (some models do not support this parameter, but you still need to query the result by id), you **must** call the Query Result endpoint to retrieve the final output. ```bash cURL theme={null} curl -X GET "https://gptproto.com/api/v3/predictions/{id}/result" \ -H "Authorization: GPTPROTO_API_KEY" \ -H "Content-Type: application/json" ``` ```python Python theme={null} import requests import json url = "https://gptproto.com/api/v3/predictions/{id}/result" headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers) result = response.json() print(json.dumps(result, indent=2)) ``` ```javascript JavaScript theme={null} const url = "https://gptproto.com/api/v3/predictions/{id}/result"; const headers = { "Authorization: GPTPROTO_API_KEY", "Content-Type": "application/json" }; fetch(url, { method: "GET", headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` ```go Go theme={null} package main import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://gptproto.com/api/v3/predictions/{id}/result" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Authorization", "GPTPROTO_API_KEY") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } ``` After submitting your prediction request, the response will contain the id you need.\ You can find it in either: * `data.id` – the unique identifier of the prediction * `data.urls[0].get` – a ready-to-use GET URL that already embeds the id ```json theme={null} { "data": { "id": "abc", "model": "model_name", "outputs": [], "urls": { "get": "https://gptproto.com/api/v3/predictions/abc/result" }, "status": "completed", "error": null, "executionTime": 0, "timings": { "inference": 0 }, "has_nsfw_contents": [], "created_at": "2026-01-01 00:00:00" }, "message": "success", "code": 200 } ``` ## Parameters | Parameter | Type | Required | Default | Range | Description | | ------------------------- | ------- | -------- | ------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `prompt` | string | ✅ Yes | - | - | The positive prompt for the generation. Must not exceed 2,500 characters. | | `negative_prompt` | string | ❌ No | - | - | The negative prompt for the generation. Must not exceed 2,500 characters. | | `image` | string | ❌ No | - | - | Source image for image-to-video generation. | | `sound` | boolean | ❌ No | `true` | `true, false` | Whether to include synchronized sound with the video. | | `aspect_ratio` | string | ❌ No | `16:9` | `16:9, 1:1, 9:16` | The aspect ratio of the generated video. **This parameter is required when the image-to-video or video editing features are not used.** | | `duration` | integer | ❌ No | `5` | `3-15` | The duration of the generated media in seconds. | | `guidance_scale` | number | ❌ No | - | `0-1` | The guidance scale for the generation. Controls how closely the output follows the prompt. | | `multi_prompt` | array | ❌ No | - | - | A list of segmented prompts for multi-scene video generation. Each segment specifies its own prompt and duration. **Only supported by V3.0 (`kling-v3.0`).** | | `multi_prompt[].index` | integer | ✅ Yes | - | - | The index of the segment, starting from 1. | | `multi_prompt[].prompt` | string | ✅ Yes | - | -