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

> ## Agent Instructions
> Phaseo Gateway base URL: https://api.phaseo.app/v1. Send `Authorization: Bearer $PHASEO_API_KEY` with every request.
> Model IDs look like `provider/model`, for example `openai/gpt-6-astra`. Do not guess IDs: list them with `GET /v1/models` or check https://phaseo.app/models. `phaseo/free` routes to an available free model and needs no wallet balance.
> For new text integrations prefer `POST /v1/responses`. `POST /v1/chat/completions` (OpenAI format) and `POST /v1/messages` (Anthropic format) suit existing code.
> The full API contract is https://phaseo.app/docs/openapi/v1/openapi.yaml. Official SDKs: `@phaseo/sdk` (TypeScript) and `phaseo` (Python), plus Go, C#, PHP, Ruby and Rust.
> Search these docs over MCP at https://phaseo.app/docs/mcp, and install Phaseo skills with `npx skills add https://phaseo.app/docs`. If a page is wrong or out of date, report it with the MCP `submit_feedback` tool.
> Manage Phaseo accounts with the `phaseo` CLI (`npm install -g @phaseo/cli`, then `phaseo login` or `phaseo login --device-code`), the `/v1` Management API or the MCP server at `https://mcp.phaseo.app/mcp?access=manage`. Do not send users to the dashboard for account tasks. A person is still needed for sign-up, approving a sign-in, paying the first top-up on the checkout link that `phaseo credits add` returns when no card is saved, confirming each saved-card top-up from the emailed link, and account security (password, MFA, passkeys). Create API keys with `phaseo keys create --name <name> --json`; never guess one. Credit top-ups need `phaseo login --scopes billing:write` first. Task map: https://phaseo.app/docs/v1/developers/manage-from-an-agent.md.

# इमेज जनरेशन

> किसी भी Phaseo SDK से /images/generations के ज़रिए इमेज बनाएँ।

`POST /v1/images/generations` भेजने के लिए SDK का इमेज मेथड मॉडल और प्रॉम्प्ट के साथ कॉल करें। हर बनी हुई इमेज `data` में `url` या `b64_json` एंट्री के रूप में लौटती है।

```typescript TypeScript theme={null}
const image = await client.generateImage({
  model: "openai/gpt-image-1",
  prompt: "A lighthouse at golden hour",
  size: "1024x1024",
  n: 1,
});
```

```python Python theme={null}
image = client.generate_image({
    "model": "openai/gpt-image-1",
    "prompt": "A lighthouse at golden hour",
    "size": "1024x1024",
    "n": 1,
})
```

```go Go theme={null}
client, err := phaseo.NewFromEnv()
if err != nil {
  panic(err)
}

resp, err := client.CreateImage(context.Background(), map[string]interface{}{
  "model":  "openai/gpt-image-1",
  "prompt": "A lighthouse at golden hour",
  "size":   "1024x1024",
})
if err != nil {
  panic(err)
}
fmt.Println(resp["data"])
```

```csharp C# theme={null}
using PhaseoSdk;

var client = new Phaseo();

var response = await client.GenerateImage(new Dictionary<string, object>
{
    ["model"] = "openai/gpt-image-1",
    ["prompt"] = "A lighthouse at golden hour",
    ["size"] = "1024x1024",
    ["n"] = 1,
});
```

```php PHP theme={null}
<?php
require 'vendor/autoload.php';

use Phaseo\Sdk\Phaseo;

$client = new Phaseo();

$response = $client->generateImage([
    'model' => 'openai/gpt-image-1',
    'prompt' => 'A lighthouse at golden hour',
    'size' => '1024x1024',
    'n' => 1,
]);
```

```ruby Ruby theme={null}
require 'phaseo_sdk'

client = PhaseoSdk::Phaseo.new

response = client.generate_image(
  model: 'openai/gpt-image-1',
  prompt: 'A lighthouse at golden hour',
  size: '1024x1024',
  n: 1
)
```

```java Java theme={null}
import app.phaseo.sdk.Phaseo;
import java.util.Map;

Phaseo client = new Phaseo(System.getenv("PHASEO_API_KEY"));

var response = client.createImage(Map.of(
    "model", "openai/gpt-image-1",
    "prompt", "A lighthouse at golden hour"
));
System.out.println(response);
```

```rust Rust theme={null}
let response = client.post("/images/generations", &json!({
    "model": "openai/gpt-image-1",
    "prompt": "A lighthouse at golden hour",
    "size": "1024x1024"
}))?;
```

| भाषा | मेथड | नोट |
| - | - | - |
| TypeScript | `client.generateImage(request)` | `client.streamImage()` वही अनुरोध `stream: true` के साथ भेजता है और आंशिक-इमेज इवेंट देता है। |
| Python | `client.generate_image(request)` | `client.images.generate(request)` भी यही करता है। इमेज स्ट्रीमिंग का कोई हेल्पर नहीं है। |
| Go | `client.CreateImage(ctx, req)` | `map[string]interface{}` लौटाता है। |
| C# | `client.GenerateImage(request)`, उपनाम `CreateImage` | `Dictionary<string, object>?` लौटाता है। |
| PHP | `$client->generateImage($request)`, उपनाम `createImage()` | एक array लौटाता है। |
| Ruby | `client.generate_image(...)`, उपनाम `create_image` | एक Hash लौटाता है। |
| Java | `client.createImage(request)` | `Map` या Jackson `JsonNode` लेता है; `JsonNode` लौटाता है। |
| Rust | कोई इमेज हेल्पर नहीं | `client.post("/images/generations", &request)` JSON बॉडी भेजता है और `PhaseoResponse` लौटाता है। |

## पैरामीटर

हर SDK में फ़ील्ड के नाम JSON बॉडी के फ़ील्ड ही हैं।

| फ़ील्ड | नोट |
| - | - |
| `model`, `prompt` | ज़रूरी। GPT Image प्रॉम्प्ट 32,000 अक्षरों तक हो सकते हैं। |
| `n` | इमेज की संख्या, `1` से `10`। |
| `size` | उदाहरण के लिए `1024x1024`, `1024x1792` या `1792x1024`; समर्थित साइज़ मॉडल पर निर्भर करते हैं। |
| `aspect_ratio`, `width`, `height` | `size` के मॉडल-निर्भर विकल्प। |
| `quality` | मॉडल-निर्भर: `dall-e-3` पर `standard` या `hd`; GPT Image मॉडलों पर `auto`, `low`, `medium` या `high`। |
| `output_format`, `output_compression` | `png`, `jpeg` या `webp`; कंप्रेशन (`0` से `100`) के लिए `jpeg` या `webp` चाहिए। |
| `background` | `transparent`, `opaque` या `auto`। ट्रांसपेरेंट के लिए `png` या `webp` चाहिए। |
| `response_format` | `url` या `b64_json`। GPT Image मॉडल इस फ़ील्ड को अस्वीकार करते हैं। |
| `style` | मॉडल-निर्भर, जैसे `dall-e-3` पर `vivid` या `natural`। GPT Image मॉडल इस फ़ील्ड को अस्वीकार करते हैं। |
| `stream`, `partial_images` | TypeScript में `streamImage()` से `3` तक आंशिक इमेज स्ट्रीम करें। |
| `user` | दुरुपयोग ट्रैक करने के लिए एंड-यूज़र टैग। |

पूरा स्कीमा [Image generations API संदर्भ](https://phaseo.app/docs/hi/v1/api-reference/endpoint/images-generations.md) में है।

## प्रतिक्रिया

`ImagesGenerationResponse`:

```json theme={null}
{
  "data": [
    {
      "url": "https://example.com/generated_image.png"
    }
  ]
}
```

जो मॉडल इमेज बाइट लौटाते हैं, वे उन्हें `url` की जगह `b64_json` में रखते हैं।


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.