---
title: OpenAI Transcription Zamiana mowy na tekst | RunAPI
description: Użyj punktu końcowego speech to text, aby otrzymać wynik w tej samej
  odpowiedzi.
url: https://runapi.ai/pl/docs/api/openai-transcription/speech-to-text.md
canonical: https://runapi.ai/pl/docs/api/openai-transcription/speech-to-text
locale: pl
---

> Wersja HTML: https://runapi.ai/pl/docs/api/openai-transcription/speech-to-text
> Indeks witryny dla agentów: https://runapi.ai/llms.txt

# OpenAI Transcription Zamiana mowy na tekst

## Omówienie

Użyj punktu końcowego speech to text i odczytaj wynik z tej samej odpowiedzi.

### Szybki start

1. Utwórz klucz API i ustaw go jako RUNAPI_API_KEY.
2. Wyślij żądanie POST, którego treść odpowiada schematowi żądania.
3. Odczytaj wynik z treści pomyślnej odpowiedzi.

## Punkt końcowy

POST /v1/audio/transcriptions

Bazowy URL: https://runapi.ai

Wersja API: v1

Uwierzytelnianie: Authorization: Bearer YOUR_API_TOKEN

## Obsługiwane modele

Otwórz stronę modelu, aby zapoznać się z aktualnymi cenami, limitami żądań i szczegółami dotyczącymi użytku komercyjnego.

- [gpt-transcribe](https://runapi.ai/pl/models/openai-transcription/gpt-transcribe)
- [whisper-1](https://runapi.ai/pl/models/openai-transcription/whisper-1)

## Schemat żądania

Wysyłaj wyłącznie pola zadeklarowane dla tego punktu końcowego.

### gpt-transcribe

```json
{
  "file": {
    "description": "Przesyłanie pliku audio, do 25 MB.",
    "required": true,
    "type": "string"
  },
  "keywords": {
    "description": "Terminy, które powinny otrzymać dodatkowe wskazówki dotyczące rozpoznawania.",
    "items": {
      "type": "string"
    },
    "type": "array"
  },
  "language": {
    "description": "Język audio jako kod ISO-639-1.",
    "type": "string"
  },
  "languages": {
    "description": "Kandydujące języki audio jako kody ISO-639-1.",
    "items": {
      "type": "string"
    },
    "type": "array"
  },
  "model": {
    "description": "Model transkrypcji.",
    "enum": [
      "gpt-transcribe"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Opcjonalny tekst wpływający na styl i słownictwo transkrypcji.",
    "type": "string"
  },
  "response_format": {
    "description": "Format treści odpowiedzi.",
    "enum": [
      "json",
      "text"
    ],
    "type": "string"
  },
  "stream": {
    "description": "Czy żądać odpowiedzi strumieniowej, gdy jest obsługiwana.",
    "type": "boolean"
  },
  "temperature": {
    "description": "Temperatura próbkowania od 0 do 1.",
    "max": 1,
    "min": 0,
    "type": "number"
  }
}
```

### whisper-1

```json
{
  "file": {
    "description": "Przesyłanie pliku audio, do 25 MB.",
    "required": true,
    "type": "string"
  },
  "language": {
    "description": "Język audio jako kod ISO-639-1.",
    "type": "string"
  },
  "model": {
    "description": "Model transkrypcji.",
    "enum": [
      "whisper-1"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Opcjonalny tekst wpływający na styl i słownictwo transkrypcji.",
    "type": "string"
  },
  "response_format": {
    "description": "Format treści odpowiedzi.",
    "enum": [
      "json",
      "text",
      "srt",
      "verbose_json",
      "vtt"
    ],
    "type": "string"
  },
  "stream": {
    "description": "Czy żądać odpowiedzi strumieniowej, gdy jest obsługiwana.",
    "type": "boolean"
  },
  "temperature": {
    "description": "Temperatura próbkowania od 0 do 1.",
    "max": 1,
    "min": 0,
    "type": "number"
  },
  "timestamp_granularities": {
    "description": "Szczegółowość znacznika czasu uwzględniana w szczegółowych odpowiedziach JSON.",
    "items": {
      "enum": [
        "word",
        "segment"
      ],
      "type": "string"
    },
    "max_items": 2,
    "type": "array"
  }
}
```

## Odpowiedź sukcesu

HTTP 200 - POST /v1/audio/transcriptions

### Schemat odpowiedzi

```json
{
  "oneOf": [
    {
      "properties": {
        "duration": {
          "type": "number"
        },
        "language": {
          "type": "string"
        },
        "logprobs": {
          "items": {
            "properties": {
              "bytes": {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "logprob": {
                "type": "number"
              },
              "token": {
                "type": "string"
              }
            },
            "type": "object",
            "unevaluatedProperties": false
          },
          "type": "array"
        },
        "segments": {
          "items": {
            "properties": {
              "avg_logprob": {
                "type": "number"
              },
              "compression_ratio": {
                "type": "number"
              },
              "end": {
                "type": "number"
              },
              "id": {
                "type": "integer"
              },
              "no_speech_prob": {
                "type": "number"
              },
              "seek": {
                "type": "integer"
              },
              "start": {
                "type": "number"
              },
              "temperature": {
                "type": "number"
              },
              "text": {
                "type": "string"
              },
              "tokens": {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              }
            },
            "type": "object",
            "unevaluatedProperties": false
          },
          "type": "array"
        },
        "task": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "usage": {
          "properties": {
            "input_token_details": {
              "properties": {
                "audio_tokens": {
                  "type": "integer"
                },
                "text_tokens": {
                  "type": "integer"
                }
              },
              "type": "object",
              "unevaluatedProperties": false
            },
            "input_tokens": {
              "type": "integer"
            },
            "output_tokens": {
              "type": "integer"
            },
            "seconds": {
              "type": "number"
            },
            "total_tokens": {
              "type": "integer"
            },
            "type": {
              "type": "string"
            }
          },
          "type": "object",
          "unevaluatedProperties": false
        },
        "words": {
          "items": {
            "properties": {
              "end": {
                "type": "number"
              },
              "start": {
                "type": "number"
              },
              "word": {
                "type": "string"
              }
            },
            "required": [
              "word",
              "start",
              "end"
            ],
            "type": "object",
            "unevaluatedProperties": false
          },
          "type": "array"
        }
      },
      "required": [
        "text"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "type": "string"
    }
  ]
}
```

### Przykład odpowiedzi

```json
{
  "text": "Welcome to RunAPI."
}
```

## Błędy

HTTP 401 - POST /v1/audio/transcriptions

Ta odpowiedź nie ma treści.

## Błędy

HTTP 400 - POST /v1/audio/transcriptions

### Schemat odpowiedzi

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "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
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

```json
{
  "error": {
    "code": "invalid_request",
    "message": "Invalid request"
  }
}
```

## Błędy

HTTP 402 - POST /v1/audio/transcriptions

### Schemat odpowiedzi

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "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
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

```json
{
  "error": {
    "code": "insufficient_balance",
    "message": "Insufficient balance"
  }
}
```

## Błędy

HTTP 429 - POST /v1/audio/transcriptions

### Schemat odpowiedzi

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "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
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

```json
{
  "error": {
    "code": "api_token_credit_limit_exceeded",
    "message": "API key credit limit exceeded"
  }
}
```

## Błędy

HTTP 409 - POST /v1/audio/transcriptions

### Schemat odpowiedzi

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "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
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

## Błędy

HTTP 429 - POST /v1/audio/transcriptions

### Schemat odpowiedzi

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "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
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit reached. Please retry later."
  }
}
```

## Błędy

HTTP 503 - POST /v1/audio/transcriptions

### Schemat odpowiedzi

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "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
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

## Błędy

HTTP 504 - POST /v1/audio/transcriptions

### Schemat odpowiedzi

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "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
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "error": {
    "code": "timeout_error",
    "message": "The request timed out"
  }
}
```

## Wygenerowane przykłady kodu

Używaj bezpośrednio cURL lub zainstaluj SDK dla swojego języka. Każdy przykład przesyła zwalidowane żądanie pokazane w tej dokumentacji.

### curl

```curl
curl -X POST https://runapi.ai/v1/audio/transcriptions \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"file":"audio.mp3","model":"whisper-1","response_format":"json"}'
```

### javascript

#### Instalacja

```bash
npm install @runapi.ai/openai-transcription
```

```javascript
import { OpenaiTranscriptionClient } from "@runapi.ai/openai-transcription";

const client = new OpenaiTranscriptionClient({ apiKey: process.env.RUNAPI_API_KEY });
const result = await client.speechToText.run({
  "file": "audio.mp3",
  "model": "whisper-1",
  "response_format": "json"
});
```

### python

#### Instalacja

```bash
pip install runapi-openai-transcription
```

```python
import os
from runapi.openai_transcription import OpenaiTranscriptionClient

client = OpenaiTranscriptionClient(api_key=os.environ["RUNAPI_API_KEY"])
result = client.speech_to_text.run(
  file="audio.mp3",
  model="whisper-1",
  response_format="json"
)
```

### go

#### Instalacja

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

```go
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  openaitranscription "github.com/runapi-ai/openai-transcription-sdk/go/openaitranscription"
)

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

  result, err := client.SpeechToText.Run(context.Background(), openaitranscription.SpeechToTextParams{
    File: "audio.mp3",
    Model: "whisper-1",
    ResponseFormat: "json",
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = result
}
```

### ruby

#### Instalacja

```bash
gem install runapi-openai-transcription
```

```ruby
require "runapi/openai_transcription"

client = RunApi::OpenaiTranscription::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
result = client.speech_to_text.run(
  file: "audio.mp3",
  model: "whisper-1",
  response_format: "json"
)
```

### java

#### Instalacja

```kotlin
implementation("ai.runapi:runapi-openai-transcription")
```

```java
import ai.runapi.openaitranscription.OpenaiTranscriptionClient;
import ai.runapi.openaitranscription.types.SpeechToTextParams;
import ai.runapi.openaitranscription.types.TranscriptionResponse;

public final class Example {
  public static void main(String[] args) {
    OpenaiTranscriptionClient client = OpenaiTranscriptionClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    TranscriptionResponse result = client.speechToText().run(
        SpeechToTextParams.builder()
        .file("audio.mp3")
        .model("whisper-1")
        .responseFormat("json")
            .build()
    );
  }
}
```

### php

#### Instalacja

```bash
composer require runapi-ai/openai-transcription
```

```php
<?php

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

use RunApi\Core\ClientOptions;
use RunApi\OpenaiTranscription\OpenaiTranscriptionClient;

$client = new OpenaiTranscriptionClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$result = $client->speechToText->run([
  "file" => "audio.mp3",
  "model" => "whisper-1",
  "response_format" => "json"
]);
```

## Powiązane przewodniki

- [Uwierzytelnianie](https://runapi.ai/pl/docs/guides/authentication.md)
- [Szybki start](https://runapi.ai/pl/docs/guides/task-api/quickstart.md)

---

## Więcej od RunAPI

- [Strona główna](https://runapi.ai/pl/.md)
- [Katalog modeli](https://runapi.ai/pl/models.md)
- [Cennik](https://runapi.ai/pl/pricing.md)
- [Dostawcy](https://runapi.ai/pl/models)
- [Dokumentacja](https://runapi.ai/pl/docs/guides)
- [SDK](https://runapi.ai/pl/sdk.md)
- [CLI](https://runapi.ai/pl/cli.md)
- [Serwer MCP](https://runapi.ai/pl/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/pl/claude-code-vs-cursor.md)
- [Konfiguracja Cursor API](https://runapi.ai/pl/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/pl/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/pl/contact.md)
- [Kontakt](https://runapi.ai/pl/contact.md)
- [Regulamin](https://runapi.ai/pl/terms.md)
- [Prywatność](https://runapi.ai/pl/privacy.md)
- [Indeks witryny dla agentów](https://runapi.ai/llms.txt)

Kontakt: contact@runapi.ai

## Dane strukturalne

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "pl",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/pl",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/pl/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "pl",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/pl",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/plicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "pl",
    "@type": "TechArticle",
    "headline": "OpenAI Transcription Zamiana mowy na tekst",
    "description": "Użyj punktu końcowego speech to text, aby otrzymać wynik w tej samej odpowiedzi.",
    "url": "https://runapi.ai/pl/docs/api/openai-transcription/speech-to-text",
    "mainEntityOfPage": "https://runapi.ai/pl/docs/api/openai-transcription/speech-to-text"
  }
]
```
