---
title: Kling Metinden Görsele | RunAPI
description: Standart görseller, sıralı seriler ve e-ticaret ya da web sayfası için
  uzun görseller üretin.
url: https://runapi.ai/tr/docs/api/kling/text-to-image.md
canonical: https://runapi.ai/tr/docs/api/kling/text-to-image
locale: tr
---

> HTML sürümü: https://runapi.ai/tr/docs/api/kling/text-to-image
> Ajanlar için site dizini: https://runapi.ai/llms.txt

# Kling Metinden Görsele

## Genel Bakış

Metinden görüntüye uç noktasını desteklenen bir modelle kullanın. Durumunu almak için döndürülen Görev Kimliğini kullanın veya aşağıda belgelenen teslimler için callback_url sağlayın.

### Hızlı başlangıç

1. Bir API anahtarı oluşturun ve RUNAPI_API_KEY olarak ayarlayın.
2. Desteklenen bir model seçin ve gövdesi o modelin şemasıyla eşleşen bir POST isteği gönderin.
3. Döndürülen görev kimliğini saklayın, ardından bir terminal durumuna ulaşana kadar yoklama yapın ya da aşağıda belgelenen geri çağırmaları işleyin.

## Uç Nokta

POST /api/v1/kling/text_to_image

Temel URL: https://runapi.ai

API sürümü: v1

Kimlik doğrulama: Authorization: Bearer YOUR_API_TOKEN

## Desteklenen modeller

Güncel fiyatlandırma, hız sınırları ve ticari kullanım ayrıntıları için bir model sayfası açın.

- [kling-v4-image](https://runapi.ai/tr/models/kling/v4-image)
- [kling-v4-long-image](https://runapi.ai/tr/models/kling/v4-long-image)

## İstek şeması

Alanlar ve izin verilen değerler seçili modele göre değişir. Sağlandığında, callback_url aşağıda belgelenen Görev teslimatlarını alır.

### kling-v4-image

```json
{
  "aspect_ratio": {
    "default": "auto",
    "description": "Çıktı en boy oranı.",
    "enum": [
      "auto",
      "9:16",
      "2:3",
      "3:4",
      "1:1",
      "4:3",
      "3:2",
      "16:9",
      "21:9"
    ],
    "type": "string"
  },
  "callback_url": {
    "description": "Asenkron bildirimler için webhook URL'si.",
    "type": "string"
  },
  "elements": {
    "description": "Her biri bir giriş materyali sayılan adlandırılmış referanslar. Adlar büyük/küçük harf ayrımı olmadan benzersizdir; image_N ve object_N ayrılmıştır.",
    "items": {
      "properties": {
        "description": {
          "length": true,
          "max": 100,
          "type": "string"
        },
        "image_urls": {
          "items": {
            "type": "string"
          },
          "max_items": 4,
          "min_items": 2,
          "required": true,
          "type": "array"
        },
        "name": {
          "length": true,
          "max": 20,
          "min": 1,
          "required": true,
          "type": "string"
        },
        "tag": {
          "enum": [
            "character",
            "animal",
            "prop",
            "costume",
            "scene",
            "effect",
            "others"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "max_items": 10,
    "type": "array"
  },
  "mode": {
    "default": "default",
    "description": "Tekli/varsayılan üretim veya ilişkili bir görsel serisi.",
    "enum": [
      "default",
      "series"
    ],
    "type": "string"
  },
  "model": {
    "description": "Kling 4.0 görsel modeli tanımlayıcısı.",
    "required": true,
    "type": "string"
  },
  "output_count": {
    "default": 1,
    "description": "Varsayılan modda 1–9; seri modunda 2–10 zorunlu.",
    "max": 10,
    "min": 1,
    "type": "integer"
  },
  "output_resolution": {
    "default": "2k",
    "description": "Çıktı çözünürlüğü.",
    "enum": [
      "2k",
      "4k",
      "8k"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Görsel açıklaması; sağlanan görsellere @image_N, öğelere ise @name ile referans verin.",
    "length": true,
    "max": 20000,
    "min": 1,
    "required": true,
    "type": "string"
  },
  "source_image_urls": {
    "description": "HTTP/HTTPS üzerinden herkese açık JPG veya PNG görseller, her biri en fazla 20 MB. Görseller ve öğeler toplamda en fazla 10.",
    "items": {
      "type": "string"
    },
    "max_items": 10,
    "type": "array"
  }
}
```

### kling-v4-long-image

```json
{
  "callback_url": {
    "description": "Asenkron bildirimler için webhook URL'si.",
    "type": "string"
  },
  "length": {
    "default": "medium",
    "description": "E-ticaret görselinin uzunluğu.",
    "enum": [
      "short",
      "medium",
      "long"
    ],
    "type": "string"
  },
  "model": {
    "description": "Kling 4.0 uzun görsel modeli tanımlayıcısı.",
    "required": true,
    "type": "string"
  },
  "output_resolution": {
    "default": "2k",
    "description": "Çıktı çözünürlüğü.",
    "enum": [
      "1k",
      "2k"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Uzun görsel açıklaması. Referanslar sağlanan görselleri adlandırmalıdır: @image_N, @style veya @subject.",
    "length": true,
    "max": 20000,
    "min": 1,
    "required": true,
    "type": "string"
  },
  "skill": {
    "description": "Uzun görsel skill'i; büyük/küçük harfe duyarlı değildir.",
    "enum": [
      "ecommerce",
      "webpage"
    ],
    "required": true,
    "type": "string"
  },
  "source_image_urls": {
    "description": "E-ticaret ürün görselleri: HTTP/HTTPS üzerinden herkese açık JPG veya PNG, her biri en fazla 20 MB.",
    "items": {
      "type": "string"
    },
    "max_items": 3,
    "min_items": 1,
    "type": "array"
  },
  "style_image_url": {
    "description": "İsteğe bağlı web sayfası stil referansı: HTTP/HTTPS üzerinden herkese açık JPG veya PNG, en fazla 20 MB.",
    "type": "string"
  },
  "subject_image_url": {
    "description": "İsteğe bağlı web sayfası özne referansı: HTTP/HTTPS üzerinden herkese açık JPG veya PNG, en fazla 20 MB.",
    "type": "string"
  }
}
```

#### Koşullu kurallar

Bu gereksinimler, listelenen tüm koşulların eşleştiği durumlarda uygulanır.

- **Şu durumlarda**: `model` = `kling-v4-image`; **Kabul edilmez**: `skill`, `length`, `style_image_url`, `subject_image_url`
- **Şu durumlarda**: `mode` = `series`, `model` = `kling-v4-image`; **Gerekli**: `output_count`
- **Şu durumlarda**: `mode` = `default`, `model` = `kling-v4-image`
- **Şu durumlarda**: `mode absent`, `model` = `kling-v4-image`
- **Şu durumlarda**: `model` = `kling-v4-long-image`; **Kabul edilmez**: `mode`, `output_count`, `elements`, `aspect_ratio`
- **Şu durumlarda**: `model` = `kling-v4-long-image`, `skill` = `ecommerce`; **Gerekli**: `source_image_urls`; **Kabul edilmez**: `style_image_url`, `subject_image_url`
- **Şu durumlarda**: `model` = `kling-v4-long-image`, `skill` = `webpage`; **Kabul edilmez**: `source_image_urls`, `length`

## Kabul oluştur

HTTP 202 - POST /api/v1/kling/text_to_image

### Yanıt şeması

```json
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    },
    "task_replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "status"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## Yoklama işleniyor

HTTP 200 - GET /api/v1/kling/text_to_image/:id

### Yanıt şeması

```json
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## Yoklama tamamlandı

HTTP 200 - GET /api/v1/kling/text_to_image/:id

### Yanıt şeması

```json
{
  "properties": {
    "id": {
      "type": "string"
    },
    "images": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "usage": {
      "properties": {
        "cost": {
          "type": "number"
        }
      },
      "required": [
        "cost"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "id",
    "status",
    "images",
    "usage"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "id": "tsk_reference_demo",
  "images": [
    {
      "url": "https://cdn.runapi.ai/public/samples/image.jpg"
    }
  ],
  "status": "completed",
  "usage": {
    "cost": 0.05
  }
}
```

## Yoklama başarısız oldu

HTTP 200 - GET /api/v1/kling/text_to_image/:id

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "Task processing failed.",
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## Müşteri geri çağırması: tamamlandı

HTTP 200 - POST callback_url

### Yanıt şeması

```json
{
  "properties": {
    "id": {
      "type": "string"
    },
    "images": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "usage": {
      "properties": {
        "cost": {
          "type": "number"
        }
      },
      "required": [
        "cost"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  },
  "required": [
    "id",
    "status",
    "images",
    "usage"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "id": "tsk_reference_demo",
  "images": [
    {
      "url": "https://cdn.runapi.ai/public/samples/image.jpg"
    }
  ],
  "status": "completed",
  "usage": {
    "cost": 0.05
  }
}
```

## Müşteri geri çağırması: başarısız oldu

HTTP 200 - POST callback_url

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "limit_cents": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "reset_at": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "used_cents": {
              "type": "integer"
            },
            "window": {
              "enum": [
                "1h",
                "1d",
                "7d",
                "daily",
                "weekly",
                "monthly",
                "lifetime"
              ],
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object",
          "unevaluatedProperties": false
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": {
    "code": "generation_failed",
    "message": "Task processing failed."
  },
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## Hatalar

HTTP 401 - POST /api/v1/kling/text_to_image

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "Authentication required"
}
```

## Hatalar

HTTP 401 - GET /api/v1/kling/text_to_image/:id

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "Authentication required"
}
```

## Hatalar

HTTP 400 - POST /api/v1/kling/text_to_image

### Yanıt şeması

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "İnsan tarafından okunabilir hata mesajı.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "İnsan tarafından okunabilir doğrulama özeti.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Herkese açık istek alanına göre anahtarlanan doğrulama mesajları; her alan için insan tarafından okunabilir dizelerden oluşan bir dizi içerir.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### Yanıt örneği

```json
{
  "error": "model must be one of: kling-v4-image, kling-v4-long-image"
}
```

## Hatalar

HTTP 402 - POST /api/v1/kling/text_to_image

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "Insufficient balance"
}
```

## Hatalar

HTTP 429 - POST /api/v1/kling/text_to_image

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "API key credit limit exceeded"
}
```

## Hatalar

HTTP 409 - POST /api/v1/kling/text_to_image

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "The request uses features that are not supported for the selected model"
}
```

## Hatalar

HTTP 429 - POST /api/v1/kling/text_to_image

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "Rate limit reached. Please retry later."
}
```

## Hatalar

HTTP 503 - POST /api/v1/kling/text_to_image

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "Service under maintenance, please try again later"
}
```

## Hatalar

HTTP 503 - POST /api/v1/kling/text_to_image

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "The request timed out"
}
```

## Hatalar

HTTP 404 - GET /api/v1/kling/text_to_image/:id

### Yanıt şeması

```json
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Yanıt örneği

```json
{
  "error": "Task with id 'tsk_reference_demo' not found"
}
```

## Oluşturulan Kod Örnekleri

Doğrudan cURL kullanın veya diliniz için bir SDK yükleyin. Her örnek, bu başvuruda gösterilen doğrulanmış isteği gönderir.

### curl

```curl
curl -X POST https://runapi.ai/api/v1/kling/text_to_image \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"model":"kling-v4-image","prompt":"A red apple on a white table","output_resolution":"2k","output_count":1}'
```

### javascript

#### Yükle

```bash
npm install @runapi.ai/kling
```

```javascript
import { KlingClient } from "@runapi.ai/kling";

const client = new KlingClient({ apiKey: process.env.RUNAPI_API_KEY });
const task = await client.textToImage.create({
  "model": "kling-v4-image",
  "prompt": "A red apple on a white table",
  "output_resolution": "2k",
  "output_count": 1
});
```

### python

#### Yükle

```bash
pip install runapi-kling
```

```python
import os
from runapi.kling import KlingClient

client = KlingClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.text_to_image.create(
  model="kling-v4-image",
  prompt="A red apple on a white table",
  output_resolution="2k",
  output_count=1
)
```

### go

#### Yükle

```bash
go get github.com/runapi-ai/kling-sdk/go@latest
```

```go
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  kling "github.com/runapi-ai/kling-sdk/go/kling"
)

func main() {
  client, err := kling.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
  if err != nil {
    log.Fatal(err)
  }

  task, err := client.TextToImage.Create(context.Background(), kling.TextToImageParams{
    Model: kling.TextToImageModel("kling-v4-image"),
    Prompt: "A red apple on a white table",
    OutputResolution: "2k",
    OutputCount: 1,
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = task
}
```

### ruby

#### Yükle

```bash
gem install runapi-kling
```

```ruby
require "runapi/kling"

client = RunApi::Kling::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
task = client.text_to_image.create(
  model: "kling-v4-image",
  prompt: "A red apple on a white table",
  output_resolution: "2k",
  output_count: 1
)
```

### java

#### Yükle

```kotlin
implementation("ai.runapi:runapi-kling")
```

```java
import ai.runapi.kling.KlingClient;
import ai.runapi.kling.types.TextToImageParams;
import ai.runapi.core.polling.TaskCreateResponse;

public final class Example {
  public static void main(String[] args) {
    KlingClient client = KlingClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    TaskCreateResponse task = client.textToImage().create(
        TextToImageParams.builder()
        .model(new ai.runapi.kling.types.TextToImageModel("kling-v4-image"))
        .prompt("A red apple on a white table")
        .outputResolution("2k")
        .outputCount(1)
            .build()
    );
  }
}
```

### php

#### Yükle

```bash
composer require runapi-ai/kling
```

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use RunApi\Core\ClientOptions;
use RunApi\Kling\KlingClient;

$client = new KlingClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$task = $client->textToImage->create([
  "model" => "kling-v4-image",
  "prompt" => "A red apple on a white table",
  "output_resolution" => "2k",
  "output_count" => 1
]);
```

## İlgili Kılavuzlar

- [Kimlik doğrulama](https://runapi.ai/tr/docs/guides/authentication.md)
- [Hızlı başlangıç](https://runapi.ai/tr/docs/guides/task-api/quickstart.md)
- [Kling 4.0 görselleri](https://runapi.ai/tr/docs/guides/task-api/kling-images.md)

---

## RunAPI hakkında daha fazlası

- [Ana sayfa](https://runapi.ai/tr/.md)
- [Model Kataloğu](https://runapi.ai/tr/models.md)
- [Fiyatlandırma](https://runapi.ai/tr/pricing.md)
- [Sağlayıcılar](https://runapi.ai/tr/models)
- [Prompt Galerisi](https://runapi.ai/tr/prompts.md)
- [Dokümantasyon](https://runapi.ai/tr/docs/guides)
- [SDK'lar](https://runapi.ai/tr/sdk.md)
- [CLI](https://runapi.ai/tr/cli.md)
- [MCP Sunucusu](https://runapi.ai/tr/mcp.md)
- [x402](https://runapi.ai/tr/x402.md)
- [Claude Code ve Cursor](https://runapi.ai/tr/claude-code-vs-cursor.md)
- [Cursor API kurulumu](https://runapi.ai/tr/cursor-api-setup.md)
- [RunAPI ve OpenRouter](https://runapi.ai/tr/openrouter-alternative.md)
- [Kurumsal](https://runapi.ai/tr/contact.md)
- [Davet programı](https://runapi.ai/tr/referral-program.md)
- [İletişim](https://runapi.ai/tr/contact.md)
- [Şartlar](https://runapi.ai/tr/terms.md)
- [Gizlilik](https://runapi.ai/tr/privacy.md)
- [Ajanlar için site dizini](https://runapi.ai/llms.txt)

İletişim: contact@runapi.ai

## Yapılandırılmış veriler

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "tr",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/tr",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/tr/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "tr",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/tr",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/icon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "tr",
    "@type": "TechArticle",
    "headline": "Kling Metinden Görsele",
    "description": "Standart görseller, sıralı seriler ve e-ticaret ya da web sayfası için uzun görseller üretin.",
    "url": "https://runapi.ai/tr/docs/api/kling/text-to-image",
    "mainEntityOfPage": "https://runapi.ai/tr/docs/api/kling/text-to-image"
  }
]
```
