کلید دسترسی به وب‌سرویس
برای دسترسی به وب سرویس‌های iotype کلید تولید شده زیر را در Header درخواست با عنوان Authorization و با مقدار به صورت Bearer [Token] قرار دهید.

راهنمای احراز هویت در api

در وب سرویس آی او تایپ تمامی درخواست‌های می بایست همراه با TOKEN دریافت شده از سایت آی او تایپ ارسال شود. برای این منظور بر روی دکمه تولید توکن کلیک نمایید. توکن را دریافت کنید. توکن دریافتی را در سرآیند (Header) درخواست در پارامتر Authorization قرار دهید و مقدار آن را به صورت Bearer [Token] وارد کنید. در صورت خطا در احراز هویت ، به دلیل منقضی شدن توکن ، اتمام حجم توکن یا خطا در ارسال Header ، پیام خطای Unauthorized 401 نمایش داده می شود.
این متن برای دستیارهای هوش مصنوعی است.

Iotype API authentication — bearer token.

Required request headers on every call: Authorization: Bearer <TOKEN> · Accept: application/json · X-Requested-With: XMLHttpRequest

Add Content-Type: application/json on the JSON endpoints (/io/v1/translate, /io/v1/synthesis, /io/v1/files, /io/v1/file/track). On the multipart upload endpoints (/io/v1/ocr, /io/v1/transcribe, /io/v1/transcribe/instant) do not set Content-Type manually — let the HTTP client set it so the multipart boundary is generated correctly.

Credential types and their scope

There are two credential types, and their scopes do not overlap.

Credential Where it is accepted Where it must never appear
Access Token Every HTTP endpoint, and the realtime WebSocket when opened from your own server any client you do not control
Flash Token The realtime ASR WebSocket only (wss://iotype.com/socket/realtime)

A Flash Token is scoped to the realtime speech-to-text service and nothing else. No HTTP endpoint accepts one. Transcription, OCR, translation, text-to-speech and the file endpoints all authenticate with an Access Token, which means those calls belong on your server, not in client-side code.

The Flash Token exists for a single problem: streaming ASR requires the browser or mobile app to open the WebSocket itself, so some credential must reach the client. A Flash Token is short-lived and single-use, so a leaked one is far less damaging than a leaked Access Token.

Delegation flow for realtime ASR:

your server  --(Access Token)--> iotype        mint a Flash Token
your server  --(Flash Token)---> your client
your client  --(Flash Token)---> wss://iotype.com/socket/realtime

In the WebSocket handshake, the credential type is declared in config.type as either access_token or flash_token.

Machine-readable documentation:

  • Full guide: https://raw.githubusercontent.com/iotype-ai/iotype-api/main/docs/en/authentication.md
  • Errors and status codes: https://raw.githubusercontent.com/iotype-ai/iotype-api/main/docs/en/errors.md
  • OpenAPI 3.1 specification: https://raw.githubusercontent.com/iotype-ai/iotype-api/main/spec/openapi.yaml
  • Repository and runnable examples: https://github.com/iotype-ai/iotype-api

Official SDKs: pip install iotype-ai · composer require iotype-ai/sdk · npm i @iotype-ai/sdk · go get github.com/iotype-ai/iotype-api/sdk/go All four read the credential from the IOTYPE_TOKEN environment variable.

Implementation notes that are commonly got wrong:

  1. Do not send an Access Token to client-side code. Anything shipped to a user's device can be read by that user. This is the most common security mistake with this API.
  2. Do not attempt to authenticate an HTTP call with a Flash Token. It is not a general-purpose client credential; it only opens an ASR socket.
  3. Read the token from an environment variable. Generated example code must not embed it as a string literal — that is how credentials reach a git history.
  4. 401 Unauthorized covers four distinct conditions: missing token, malformed token, expired token, and an exhausted token balance. Surface all four in your error message; a user who has merely run out of credit but is told "invalid token" will debug the wrong thing.
  5. Failed requests do not consume tokens.

New accounts receive 300 free tokens. Pricing: https://iotype.com/plans/api

پروتکل‌های ارتباطی
تمامی ارتباطات با وب سرویس‌های iotype با استفاده از دو پروتکل https و wss انجام می شود. از پروتکل wss برای ارتباطات در سرویس‌های بلادرنگ (آنی) مانند api تبدیل گفتار به نوشتار استفاده می شود. احراز هویت درخواست های ارسالی به iotype از طریق Bearer Token انجام می شود. تمامی درخواست‌‌های ارسالی باید در هدر خود پارامتر Authorization با مقدار Bearer [Token] داشته باشند. در غیر این صورت خطای ۴۰۱ بازگردانده می شود.
سیستم محاسبه هزینه و اعتبار توکن‌ها
در وب سرویس‌های آی او تایپ محاسبه هزینه‌ها بر اساس میزان مصرف توکن (Token-Based Usage) می باشد. هر سرویس و هر درخواست ممکن است توکن های مختلفی با توجه به حجم درخواست ، تعداد صفحات یا مدت فایل صوتی داشته باشد. در صورتی که درخواست دارای خطا باشد ، توکن مصرفی آن محاسبه نخواهد شد. برای مدیریت هزینه‌های توسعه دهندگان پکیج‌هایی با حجم های متنوع توکن ارائه شده است که با توجه به حجم استفاده می توانند از این پکیج‌ها خریداری کرده و اعتبار کیف پول توکن خود را افزایش دهند.
نحوه مصرف توکن در هر یک از سرویس ‌های iotype
API تایپ صوتی همزمان
۱ توکن برای هر ۵ کلمه گفتار (سکوت هزینه ندارد)
API فایل صوتی به متن
۵۰ توکن برای هر دقیقه تبدیل فایل صوتی به متن (سکوت هم هزینه دارد)
وب سرویس ocr
هر عکس یا هر صفحه PDF مقدار ۲۵۰ توکن (صفحه خالی هم هزینه دارد)
API ترجمه
هر کلمه ۱ توکن
API متن به صوت
هر کلمه ۱ توکن
پکیج‌های وب سرویس آی او تایپ
به منظور مدیریت هزینه استفاده از وب سرویس‌های آی او تایپ ، توکن‌ها به صورت پکیج‌ها با حجم های متنوع ارائه شده اند تا توسعه دهندگان مطابق با نیاز‌های خود پکیح مورد نظر را انتخاب نمایند.
اعتبار رایگان برای تست وب سرویس
به منظور ارزیابی عملکرد api آی او تایپ ۳۰۰ توکن اولیه در کیف توکن توسعه دهندگان شارژ شده است.
۲,۰۰۰
توکن
API
۱۵۰,۰۰۰
۱۵۰,۰۰۰تومان
۱۰,۰۰۰
توکن
API
۹۵۰,۰۰۰
۲۶٪
۷۰۰,۰۰۰تومان
۵۰,۰۰۰
توکن
API
۳,۷۵۰,۰۰۰
۳۳٪
۲,۵۰۰,۰۰۰تومان
۱۰۰,۰۰۰
توکن
API
۷,۵۰۰,۰۰۰
۴۰٪
۴,۵۰۰,۰۰۰تومان