هویدای

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

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

این صفحه از روی مشخصات OpenAPI ساخته می‌شود. متن توضیح‌ها در مشخصات به انگلیسی است.

احراز هویت

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

POST /v1/chat/completions

OpenAI-compatible 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 OPENAI_API_MAX_REQUEST_MB (40). Errors always use the OpenAI envelope, **including 401**.

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

بدنهٔ درخواست (JSON)
نامنوعالزامیتوضیح
modelstringبلهCatalog slug or auto.
messagesobject[]بله
max_tokensintegerخیر
max_completion_tokensintegerخیر
temperaturenumberخیر
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 models usable by the caller's plan

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

فیلدهای پاسخ موفق
نامنوعالزامیتوضیح
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بله
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" | "insufficient_credits" | "permission_error" | "rate_limit_error" | "server_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, 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[]خیر

منبع: docs/openapi.yaml

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