> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gptproto.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Doubao-Seedream-5-0-260128 - Text To Image

> 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

<CodeGroup>
  ```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))
  }

  ```
</CodeGroup>

## 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)                                                |
