POST
/api/v1/alttexts
Generiert für ein übergebenes Bild einen Alternativtext. Die Rückgabe enthält den Alttext und die Dauer der reinen Bildverarbeitung (in Sekunden).
Autorisierung
notwendig
Parameter
| Name | Datentyp | Beschreibung |
|---|---|---|
| model | string | zu verwendendes LLM, mögliche Optionen siehe GET /api/v1/models |
| image | string |
Binärdaten einer Bilddatei, base64-codiert Hinweis: Je größer das übergebene Bild ist, umso länger dauert die Verarbeitung, auch wenn sich die Qualität des generierten Texts nicht mehr verbessert. Das übergebene Bild sollte daher eine maximale Kantenlänge von 512 Pixeln nicht überschreiten. |
| language | string | Sprache (de, en), Default: de |
| caption | string | Bildunterschrift, die beispielsweise auf dem Foto abgebildete Personen oder Orte benennt |
Beispiel
{
"model": "mistral-small3.2:latest",
"image": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAAKnRFWHRDcmVhdGlvbiBUaW1lAERvIDIgT2t0IDIwMjUgMTY6MjY6NTIgKzAxMDCmjMTcAAAAB3RJTUUH6QoCDhsMtziaewAAAAlwSFlzAAALEgAACxIB0t1+\/AAAAARnQU1BAACxjwv8YQUAAAAGdFJOUwD\/AP8A\/zdYG30AAAIVSURBVHja7dJBDcAgAMBAmD98IRsTa0jInYI+OsfaA\/723Q7gTcYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEsYiYSwSxiJhLBLGImEsEgd8NwJlydAVwAAAAABJRU5ErkJggg==",
"language": "de"
}
Antwort-Status
{
"remote-ip": "127.0.0.1",
"status": "OK",
"alttext": "Einfarbiges blaues Rechteck.",
"duration": 2.959546149
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "submitted data is not valid JSON"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Unauthorized"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Not enough credits",
"credits": {
"total": "200",
"remaining": "0",
"valid_from": "2025-01-01",
"valid_until": "2025-01-30"
}
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Authentication required"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Authorization malformatted"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "image too large: 2000px x 2000px, max size: 512px x 512px"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "unsupported image type: application\/octet-stream"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "[language] must be one of: {de,en}"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "missing parameter: [image]"
}