Midjourney Bild zu Prompt
Beschreibe ein Bild als mögliche Texteingaben.
Übersicht
Verwenden Sie den Endpunkt „Bild zu Prompt" und lesen Sie das Ergebnis aus derselben Antwort aus.
Schnellstart
- Erstellen Sie einen API-Schlüssel und setzen Sie ihn als RUNAPI_API_KEY.
- Eine POST-Anfrage senden, deren Körper dem Anfrage-Schema entspricht.
- Das Ergebnis aus dem erfolgreichen Antwortkörper lesen.
Endpunkt
- Basis-URL
https://runapi.ai- API-Version
v1- Authentifizierung
Authorization: Bearer YOUR_API_TOKEN
Unterstützte Modelle
Öffnen Sie eine Modellseite für aktuelle Preise, Ratenlimits und Details zur kommerziellen Nutzung.
Anfrage-Schema
Nur die für diesen Endpunkt deklarierten Felder senden.
Anfragekörper1 Feld
source_image_urlstringErfolgsantwort
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"properties": {
"prompts": {
"items": {
"type": "string"
},
"maxItems": 4,
"minItems": 4,
"type": "array"
}
},
"required": [
"prompts"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
{
"prompts": [
"A quiet coastal town at sunrise in a painterly style.",
"A cinematic sunrise above a calm seaside village.",
"Warm morning light over a peaceful coastal settlement.",
"An atmospheric seaside town beneath a golden sky."
]
}
Fehler
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
{
"error": "Authentication required"
}
Fehler
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"oneOf": [
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "Menschenlesbare Validierungszusammenfassung.",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "Validierungsmeldungen nach öffentlichem Anforderungsfeld gegliedert, mit einem Array menschenlesbarer Zeichenketten für jedes Feld.",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
Antwortbeispiel
{
"error": "source_image_url is required"
}
Fehler
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
{
"error": "Insufficient balance"
}
Fehler
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
{
"error": "API key credit limit exceeded"
}
Fehler
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
{
"error": "The request uses features that are not supported for the selected model"
}
Fehler
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
{
"error": "Rate limit reached. Please retry later."
}
Fehler
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
{
"error": "Pricing is pending for this endpoint"
}
Fehler
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
{
"error": "The request timed out"
}
Fehler
POST /api/v1/midjourney/image_to_prompt
Antwort-Schema
{
"properties": {
"error": {
"description": "Für Menschen lesbare Fehlermeldung.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Antwortbeispiel
{
"error": "Bad Gateway"
}
Generierte Code-Beispiele
Verwende cURL direkt oder installiere ein SDK für deine Programmiersprache. Jedes Beispiel übermittelt die in dieser Referenz gezeigte validierte Anfrage.
Installieren
pip install runapi-midjourney
import os
from runapi.midjourney import MidjourneyClient
client = MidjourneyClient(api_key=os.environ["RUNAPI_API_KEY"])
result = client.image_to_prompt.run(
source_image_url="https://cdn.runapi.ai/public/samples/image.jpg"
)