Mafdet AI Help Center中文

Errors & troubleshooting

When a call fails, the response carries an error code. The tables below explain each one by category.

Authentication errors

CodeHTTPMeaning & fix
401 Unauthorized401API key is wrong, missing, or malformed. Ensure the header is Authorization: Bearer sk-mafdet-…; or sign in to the console again.
missing_runtime_metadata400Called with a bare master key that has no session metadata. Use an API key created in the console.

Permission errors

CodeHTTPMeaning & fix
MODEL_NOT_ALLOWED403Your account or key has no access to this model. See Permissions & model scope, or ask an admin to grant access.
WEB_SEARCH_NOT_ENABLED403Web search is a beta capability not enabled for your account. Ask an admin to whitelist you.

Request validation

CodeHTTPMeaning & fix
model_api_surface_mismatch400This model does not run on the endpoint you called — for example an embeddings model sent to /v1/chat/completions. Check the model's API surface on Models overview. Rejected before the provider is called, so nothing is charged.
request_cost_limit_exceeded400The estimated cost of this single request exceeds the per-request cap on your key. Shorten the input, lower max_tokens, or raise the key's cost cap.
EMBEDDING_MODALITY_NOT_ENABLED400gemini-embedding-2 takes text only. Use multimodal-embedding-1 for images or video.
EMBEDDING_INPUT_EMPTY400input was empty. Send a non-empty string or array.
EMBEDDING_ITEM_TOO_LONG400A single input exceeds 100,000 characters. Split it into smaller items.
EMBEDDING_BATCH_TOO_LARGE400More than 100 inputs in one call. Send them in batches of 100 or fewer.
EMBEDDING_INPUT_TOO_LARGE400The combined input exceeds the 2 MB request limit. Send fewer or shorter items.
EMBEDDING_DIMENSIONS_INVALID400dimensions must be 768, 1536 or 3072 (default 3072).
MM_EMBEDDING_NO_IMAGE400No image found. multimodal-embedding-1 accepts images only as data:image/...;base64 data URIs — plain base64 and image_url objects are rejected.
MM_EMBEDDING_MODALITY_NOT_ENABLED400The request mixed modalities. Send images only, or one video only — not both, and not text.
MM_EMBEDDING_TOO_MANY_IMAGES400At most 8 images per request.
MM_EMBEDDING_NO_VIDEO400No video found. Send it in the Vertex-native form: {"video": {"bytesBase64Encoded": "<raw base64>"}} — a data: URI is not accepted for video.
MM_EMBEDDING_TOO_MANY_VIDEOS400One video per request.
MM_EMBEDDING_VIDEO_TOO_LONG400The clip is longer than the 6-second limit of this first release. Trim it and retry.
MM_EMBEDDING_VIDEO_TOO_LARGE400The clip is larger than 300 KB. Duration alone is not enough — a short high-bitrate clip can still exceed it. Re-encode at a lower bitrate.
MM_EMBEDDING_VIDEO_UNREADABLE400The video could not be read as an mp4, so its duration (what you are billed on) is unknown. It is refused rather than billed as zero.
VIDEO_EMBEDDING_NOT_ENABLED400Video embedding is not enabled for this deployment.
TTS_INPUT_REQUIRED400input is missing or empty.
TTS_INPUT_TOO_LONG400input exceeds 5,000 characters.
TTS_VOICE_REQUIRED400voice is required.
TTS_VOICE_NOT_ALLOWED400Not a supported voice. Use a Gemini voice — Kore, Puck, Charon, Fenrir or Aoede. OpenAI voice names such as alloy are rejected; the response lists the allowed values.
TTS_FORMAT_NOT_ALLOWED400response_format must be wav or pcm.
TTS_NOT_ENABLED400Text to speech is not enabled for this deployment.

Balance errors

CodeHTTPMeaning & fix
PLAYGROUND_CREDIT_EXHAUSTED402This period's Playground credit is used up. Wait for the next period or buy a $10 top-up; your API wallet is unaffected.
PLAYGROUND_REQUEST_EXCEEDS_REMAINING402This single request costs more than your remaining Playground credit, so it was refused up front rather than half-run.
insufficient_credit402Out of balance. See Balance & usage, or ask an admin to grant test credit.

Rate-limit errors

CodeHTTPMeaning & fix
RATE_LIMITED429Rate limited by requests per minute, tokens per minute, or search frequency. Retrying later only helps for burst limits: a single large request can exceed the per-minute token limit on its own — a video sent to the embeddings API is base64 (~929 tokens per KB), so a 300 KB clip is ~279,000 tokens. In that case use a key on a plan with a higher tpm (video embedding effectively needs Pro or above) rather than retrying.
parallel_limit_exceeded429Too many concurrent requests. Reduce requests in flight.

File upload errors

CodeHTTPMeaning & fix
FILE_TOO_LARGE400File exceeds the 50 MB per-file limit. Note that native media (image / audio / video) sent inline has a lower 15 MB ceiling, and a direct API request body must stay under 25 MB.
FILE_EMPTY400No extractable text (e.g. scanned PDF / image with no text). Use a text-based file.
FILE_TEXT_DECODE_FAILED400File is corrupted or can't be parsed (e.g. encrypted PDF). Check the file and retry.
QUERY_BLOCKED403A suspected secret (private key, token, etc.) was detected in the input and blocked. Remove sensitive content.

Upstream / provider errors

CodeHTTPMeaning & fix
PROVIDER_UNAVAILABLE503The upstream provider is temporarily unavailable. Retry later; if it persists, contact an admin.

Still stuck?