Mafdet AI Help Center中文

OpenAI-compatible tools

Any tool or SDK that speaks the OpenAI API format works with Mafdet AI — just point three settings at Mafdet AI.

Three key settings

SettingValue
Base URL / API Basehttps://api.mafdet.ai/v1
API Keyyour sk-mafdet-...
Modela Mafdet AI model ID (see Models overview)

Fields that must match

  • Base URL must end with /v1 (many tools only let you enter a domain — make sure /v1 is included)
  • Model must be a Mafdet AI model ID, not a model name from another platform
  • Auth uses Authorization: Bearer <key> (the OpenAI standard)

Official OpenAI SDK example

from openai import OpenAI

client = OpenAI(
    base_url="https://api.mafdet.ai/v1",
    api_key="sk-mafdet-xxxxxxxxxxxxxxxx",
)
resp = client.chat.completions.create(
    model="gemini-3-flash-lite",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

Common configuration mistakes

  • Base URL missing /v1 → 404 / endpoint not found
  • Model name from another platform → model not found
  • Key in the wrong place (query instead of header) → 401

Next steps