هویدای

مرجع نقطه‌های پایانی

فهرست نقطه‌های پایانی /v1 با پارامترها و پاسخ‌ها، از روی مشخصات OpenAPI.

مسیرها، پارامترها و پاسخ‌های API در یک صفحه.

احراز هویت

Authorization: Bearer <کلید hvd_...>

POST /v1/chat/completions

Chat completion (JSON or SSE). hvd_... developer key or a dashboard JWT. With stream: true the response is text/event-stream (data: {chat.completion.chunk} lines, terminated by data: [DONE]). Unknown fields are ignored. Body limit 40 MB. Errors always use the standard error envelope, **including 401**.

بدنهٔ درخواست (JSON)

بدنهٔ درخواست (JSON)
نامنوعالزامیتوضیح
modelstringبلهA public model id from GET /v1/models (an old catalog slug still works as an alias), or auto.
messagesobject[]بله
max_tokensintegerخیر
max_completion_tokensintegerخیر
temperaturenumberخیر
top_pnumberخیر
stopstring | string[]خیر
n1خیرOnly 1 is supported; any other value is refused with 400 unsupported_value.
streambooleanخیر
stream_optionsobjectخیر

فیلدهای پاسخ موفق

فیلدهای پاسخ موفق
نامنوعالزامیتوضیح
idstringبله
object"chat.completion"بله
createdintegerبله
modelstringبله
choicesobject[]بله
usageobjectبله

پاسخ‌ها

پاسخ‌ها
وضعیتتوضیح
200Completion (JSON) or event stream.
400invalid_json, missing_required_parameter, invalid_type, invalid_value, unsupported_value, invalid_image_url, too_many_images.
401invalid_api_key / token_expired / session_revoked.
402insufficient_credits / quota_exceeded (+ wallet_balance_units, quota_code).
403model_requires_paid_plan / content_blocked.
404model_not_found.
413request_too_large.
415
422context_length_exceeded / model_does_not_support_images. Also {"msg": ...} for a malformed/wrong-type token.
429rate_limit_exceeded or too_many_concurrent; carries Retry-After.
500internal_error.
502provider_error (provider failure or empty answer).
503model_unavailable / service_unavailable (+ Retry-After).
504provider_timeout.

GET /v1/models

List the public models the key can call (list shape; ids are public ids such as `vendor/model`)

فیلدهای پاسخ موفق

فیلدهای پاسخ موفق
نامنوعالزامیتوضیح
object"list"بله
dataobject[]بله

پاسخ‌ها

پاسخ‌ها
وضعیتتوضیح
200OK
401invalid_api_key / token_expired / session_revoked.
422
429rate_limit_exceeded or too_many_concurrent; carries Retry-After.
500internal_error.
503service_unavailable: catalog not seeded.

GET /v1/models/{model_id}

Retrieve one model

پارامترهای مسیر

پارامترهای مسیر
نامنوعالزامیتوضیح
model_idstringبلهpath

فیلدهای پاسخ موفق

فیلدهای پاسخ موفق
نامنوعالزامیتوضیح
idstringبلهPublic model id, e.g. vendor/model.
object"model"بله
createdintegerبله
owned_by"hoveydai"بله
context_windowintegerخیر
max_output_tokensintegerخیر
supports_visionbooleanخیر

پاسخ‌ها

پاسخ‌ها
وضعیتتوضیح
200OK
401invalid_api_key / token_expired / session_revoked.
404model_not_found.
422
429rate_limit_exceeded or too_many_concurrent; carries Retry-After.
500internal_error.
503service_unavailable.

قالب خطا

همهٔ پاسخ‌های خطای /v1 این قالب را دارند:

قالب خطا
نامنوعالزامیتوضیح
messagestringبله
type"invalid_request_error" | "authentication_error" | "insufficient_quota" | "permission_error" | "rate_limit_error" | "api_error"بله
paramstring | nullبله
codestringبلهStable code, e.g. invalid_api_key, token_expired, session_revoked, invalid_json, missing_required_parameter, invalid_type, invalid_value, unsupported_value, invalid_image_url, too_many_images, model_not_found, model_requires_paid_plan, insufficient_credits, quota_exceeded, context_length_exceeded, request_too_large, rate_limit_exceeded, too_many_concurrent, model_unavailable, service_unavailable, provider_timeout, provider_error, content_blocked, internal_error, unknown_url, method_not_allowed.
request_idstringخیرAlso sent as the x-request-id header.
quota_codestringخیر
wallet_balance_unitsintegerخیر
suggested_modelsstring[]خیر

این صفحه کمکتان نکرد؟ به ما بگویید.