BazaarLinkBazaarLink
로그인
문서API 레퍼런스SDK 레퍼런스에이전트 사용법AI 스킬

API 레퍼런스

BazaarLink API 개요

BazaarLink는 모델과 제공업체 전반에서 통일된 OpenAI 호환 요청 및 응답 형식을 제공합니다. 한 번만 연동하면 애플리케이션을 다시 작성하지 않고 모델을 전환할 수 있습니다.

OpenAPI 사양

전체 BazaarLink API는 OpenAPI 사양으로 문서화되어 있으며 YAML 및 JSON 형식으로 제공됩니다:

Swagger UI, Postman 또는 OpenAPI 호환 코드 생성기에서 이 사양을 사용해 API를 탐색하거나 클라이언트 라이브러리를 생성할 수 있습니다.

요청

채팅 완성 요청 형식

채팅 완성 요청 본문은 다음 엔드포인트로 전송됩니다:

POST/api/v1/chat/completions

지원되는 전체 필드 목록은 매개변수

요청 스키마
// Definitions of subtypes are below
type Request = {
  // Required by BazaarLink Chat Completions
  model: string;                    // Use a provider-qualified catalog ID
  messages: Message[];             // Must contain at least one message

  // Generation
  stream?: boolean;
  temperature?: number;            // Range: [0, 2]
  max_tokens?: number;             // Positive integer
  max_completion_tokens?: number;  // Alias mapped to max_tokens upstream
  n?: number;
  seed?: number;
  stop?: string | string[];

  // Sampling
  top_p?: number;
  top_k?: number;
  frequency_penalty?: number;      // Range: [-2, 2]
  presence_penalty?: number;       // Range: [-2, 2]
  repetition_penalty?: number;     // Range: (0, 2]
  min_p?: number;                  // Range: [0, 1]
  top_a?: number;                  // Range: [0, 1]

  // Token probabilities
  logit_bias?: Record<number, number>;
  logprobs?: boolean;
  top_logprobs?: number;

  // Stable end-user identifier for abuse prevention
  user?: string;

  // Tool calling
  tools?: Tool[];
  tool_choice?: ToolChoice;
  parallel_tool_calls?: boolean;

  // Structured output
  response_format?: ResponseFormat;
  structured_outputs?: boolean;

  // Plugin configuration — forwarded to upstreams that support plugins.
  plugins?: Plugin[];

  // Multimodal and image-generation options
  modalities?: Array<"text" | "image">;
  image_config?: Record<string, unknown>;
  input_audio?: InputAudio;

  // Provider-specific reasoning controls
  reasoning_effort?: "low" | "medium" | "high";
  reasoning?: ReasoningConfig;
  thinking?: ThinkingConfig;
  enable_thinking?: boolean;

  // BazaarLink message transforms and fallback routing
  transforms?: Array<"middle-out">;
  models?: string[];             // Fallback list — this drives waterfall routing, not route
  route?: "fallback";            // Passthrough only; forwarded as-is, no local effect
  provider?: ProviderPreferences;
};

// Message types
type Message =
  | SystemMessage
  | UserMessage
  | AssistantMessage
  | ToolMessage;

type SystemMessage = {
  role: "system";
  content: string | ContentPart[];
  name?: string;
};

type UserMessage = {
  role: "user";
  content: string | ContentPart[];
  name?: string;
};

type AssistantMessage = {
  role: "assistant";
  content?: string | ContentPart[] | null;
  name?: string;
  tool_calls?: ToolCall[];
};

type ToolMessage = {
  role: "tool";
  content: string;
  tool_call_id: string;
  name?: string;
};

// Multimodal content parts
type ContentPart =
  | TextContentPart
  | ImageContentPart
  | FileContentPart
  | AudioContentPart
  | VideoContentPart;

type TextContentPart = {
  type: "text";
  text: string;
};

type ImageContentPart = {
  type: "image_url";
  image_url: {
    url: string;                    // Remote URL or base64 data URI
    detail?: string;
  };
};

type FileContentPart = {
  type: "file";
  file: {
    filename?: string;
    file_data: string;              // Base64 data URI
  };
};

type AudioContentPart = {
  type: "input_audio";
  input_audio: InputAudio;
};

type InputAudio = {
  data: string;                     // Raw base64 without a data URI prefix
  format: string;                   // For example "wav" or "mp3"
};

type VideoContentPart = {
  type: "video_url";
  video_url: {
    url: string;                    // Remote URL or base64 data URI
  };
};

// Tool calling subtypes
type FunctionDescription = {
  name: string;
  description?: string;
  parameters: object;               // JSON Schema object
};

type Tool = {
  type: "function";
  function: FunctionDescription;
};

type ToolChoice =
  | "none"
  | "auto"
  | "required"
  | {
      type: "function";
      function: {
        name: string;
      };
    };

type ToolCall = {
  id: string;
  type: "function";
  function: {
    name: string;
    arguments: string;
  };
};

// Structured output
type ResponseFormat =
  | {
      type: "json_object";
    }
  | {
      type: "json_schema";
      json_schema: {
        name: string;
        strict?: boolean;
        schema: object;
      };
    };

// Upstream plugin configuration
type Plugin = {
  id: string;
  enabled?: boolean;
  [key: string]: unknown;
};

// Reasoning controls vary by model family
type ReasoningConfig = {
  effort?: "low" | "medium" | "high";
  max_tokens?: number;
  exclude?: boolean;
};

type ThinkingConfig = {
  type?: "enabled" | "disabled";
  budget_tokens?: number;
};

// Provider routing preferences
type ProviderPreferences = {
  order?: string[];
  only?: string[];
  ignore?: string[];
  allow_fallbacks?: boolean;
  sort?:
    | "price"
    | "latency"
    | "throughput"
    | {
        by: string;
        partition?: string;
      };
  require_parameters?: boolean;
  data_collection?: "allow" | "deny";
  quantizations?: string[];
  max_price?: Record<string, number>;
};

구조화된 출력

모델이 스키마에 맞는 유효한 JSON을 반환하도록 강제합니다. 모델 출력을 프로그래밍 방식으로 파싱하는 신뢰할 수 있는 애플리케이션 구축에 필수적입니다.

  • json_object기본 JSON 모드로, 모델이 유효한 JSON을 반환합니다.
  • json_schema엄격한 스키마 모드로, 출력이 제공된 JSON Schema와 일치해야 합니다.

플러그인

BazaarLink는 plugins 배열을 선택된 업스트림 경로로 전달합니다. 사용 가능 여부는 모델과 제공업체에 따라 다르며 :online 모델 변형은 web 플러그인도 활성화합니다.

JSON
{
  "model": "openai/gpt-4.1",
  "messages": [
    { "role": "user", "content": "What happened today?" }
  ],
  "plugins": [
    { "id": "web" }
  ]
}

선택적 헤더

요청 헤더에서 애플리케이션을 식별하여 사용량 추적, 대시보드 가시성, 세분화된 분석을 활성화합니다.

TypeScript
await fetch("https://bazaarlink.ai/api/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <BAZAARLINK_API_KEY>",
    "Content-Type": "application/json",
    "HTTP-Referer": "https://your-app.example",
    "X-Title": "Your App"
  },
  body: JSON.stringify({
    model: "openai/gpt-4.1",
    messages: [{ role: "user", content: "Hello!" }]
  })
});

어시스턴트 프리필

메시지 배열의 마지막에 미완성 assistant 메시지를 추가하여 호환되는 모델 경로에 이어서 생성하도록 요청합니다.

작동 방식
BazaarLink는 마지막 assistant 메시지를 보존하여 전달합니다. 이어쓰기 동작은 선택한 업스트림 모델과 공급자가 구현하므로 모든 경로에서 보장되지는 않습니다.
TypeScript
const response = await client.chat.completions.create({
  model: "anthropic/claude-sonnet-4.6",
  messages: [
    { role: "user", content: "What is the meaning of life?" },
    // Intentional partial response; compatible routes continue from here.
    { role: "assistant", content: "My best answer is" }
  ]
});

응답

BazaarLink는 모델과 제공업체의 완성 응답을 하나의 OpenAI 호환 형식으로 정규화합니다.

완성 응답 형식

choices는 항상 배열입니다. 스트리밍 응답은 delta를, 비스트리밍 응답은 message를 사용하며 가능한 경우 사용량과 비용도 반환합니다.

응답 스키마
type Response = {
  id: string;
  object: "chat.completion" | "chat.completion.chunk";
  created: number;
  model: string;
  choices: Array<NonStreamingChoice | StreamingChoice>;
  usage?: {
    prompt_tokens: number;
    completion_tokens: number;
    total_tokens: number;
    cost?: number;
    prompt_tokens_details?: {
      cached_tokens: number;
      cache_write_tokens?: number;
      audio_tokens?: number;
    };
    completion_tokens_details?: {
      reasoning_tokens?: number;
      image_tokens?: number;
    };
  };
};

type NonStreamingChoice = {
  index: number;
  finish_reason: string | null;
  native_finish_reason: string | null;
  message: {
    role: "assistant";
    content: string | null;
    tool_calls?: ToolCall[];
  };
};

type StreamingChoice = {
  index: number;
  finish_reason: string | null;
  native_finish_reason: string | null;
  delta: {
    role?: string;
    content?: string | null;
    tool_calls?: ToolCall[];
  };
};

종료 이유

finish_reason은 stop, length, tool_calls, content_filter, error 등으로 정규화되며 native_finish_reason은 제공업체의 원래 값을 보존합니다.

JSON
{
  "finish_reason": "stop",
  "native_finish_reason": "stop"
}

비용 및 통계 조회

generation ID로 단일 완료의 상세 통계 조회 (ID는 chat/completions 응답 id 또는 스트리밍 x-bz-gen-id 헤더에서).

TypeScript
const generation = await fetch(
  "https://bazaarlink.ai/api/v1/generation?id=<GENERATION_ID>",
  {
    headers: {
      Authorization: "Bearer <BAZAARLINK_API_KEY>"
    }
  }
).then((response) => response.json());

채팅 완성

기본 엔드포인트. OpenAI 채팅 완성 API와 호환됩니다.

POST/api/v1/chat/completions

요청 바디

model필수
string
모델 ID, 예: "openai/gpt-4o" 또는 "anthropic/claude-3.5-sonnet"
messages필수
Message[]
role과 content를 가진 메시지 객체 배열
stream
boolean
true이면 Server-Sent Events 스트림을 반환합니다. 기본값: false
temperature
number
샘플링 온도 0–2. 높을수록 무작위. 기본값: 1
max_tokens
integer
생성할 최대 토큰 수
max_completion_tokens
integer
max_tokens의 별칭 (OpenAI o-시리즈 호환). 둘 다 허용; 제공된 것이 적용됨
top_p
number
핵 샘플링 확률 질량. 기본값: 1
top_k
integer
상위 K개로 토큰 선택 제한. 0 = 비활성화 (모두 고려). 기본값: 0
frequency_penalty
number
반복 토큰 패널티. 범위: [-2, 2]. 기본값: 0
presence_penalty
number
존재 기반 토큰 패널티. 범위: [-2, 2]. 기본값: 0
repetition_penalty
number
입력에서 토큰 반복 감소. 범위: (0, 2]. 기본값: 1
min_p
number
상위 토큰 대비 최소 확률. 범위: [0, 1]. 기본값: 0
top_a
number
최고 확률 토큰 기반 동적 top-P. 범위: [0, 1]. 기본값: 0
seed
integer
결정적 샘플링을 위한 정수 시드. 모든 모델에서 보장되지 않음
n
integer
생성할 완성 수. 기본값: 1
user
string
모니터링 및 남용 감지를 위한 최종 사용자 식별자. 과금에 영향 없음. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.
stop
string | string[]
중지 시퀀스 — 만나면 생성 중단
logit_bias
object
토큰 ID를 바이어스 값 [-100, 100]에 매핑하여 샘플링 전 추가. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.
logprobs
boolean
각 출력 토큰의 로그 확률 반환. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.
top_logprobs
integer
위치당 반환할 최고 확률 토큰 수 (logprobs: true 필요). 범위: 0–20. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.
tools
Tool[]
모델이 호출할 수 있는 도구(함수) 목록
tool_choice
string | object
도구 사용 제어: "auto", "none", 또는 특정 도구
parallel_tool_calls
boolean
도구 제공 시 병렬 함수 호출 활성화. 기본값: true. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.
response_format
object
구조화된 JSON 출력 강제. 구조화된 출력 섹션 참조
structured_outputs
boolean
지원하는 제공자에서 엄격한 JSON 스키마 준수 출력을 요청. 그대로 전달
reasoning
object
제공자별 reasoning/thinking 설정. 그대로 전달
reasoning_effort
string
OpenAI o-시리즈 스타일 reasoning 강도: "low", "medium", 또는 "high". 그대로 전달
transforms
string[]
적용할 메시지 변환, 예: ["middle-out"]. ≤8k 컨텍스트 모델에서 자동 적용하려면 생략
models
string[]
장애 복구 모델 목록 — BazaarLink이 기본 모델 실패 시 순서대로 시도
route
string
고급 라우팅 호환 필드 — 대부분의 사용자에게는 필요하지 않습니다. 폴백에는 "models"를 사용하세요.
provider
object
고급 라우팅 설정 — 대부분의 사용자에게는 필요하지 않습니다.
user, logprobs, top_logprobs, logit_bias, parallel_tool_calls는 OpenAI 계열 모델에만 전달됩니다
이 다섯 개 매개변수는 확인된 모델이 OpenAI 자체 모델로 인식되지 않을 때 업스트림 요청에서 제거됩니다 — anthropic/claude-*, google/gemini-* 등 OpenAI가 아닌 대상으로 보내면 오류가 아니라 매개변수가 조용히 무시된 채 200을 반환합니다. 이 중 하나를 설정했는데 효과가 나타나지 않는다면, 대상 모델이 OpenAI 모델인지 확인하세요.

요청 스키마 (TypeScript)

// Definitions of subtypes are below
type Request = {
  // Required by BazaarLink Chat Completions
  model: string;                    // Use a provider-qualified catalog ID
  messages: Message[];             // Must contain at least one message

  // Generation
  stream?: boolean;
  temperature?: number;            // Range: [0, 2]
  max_tokens?: number;             // Positive integer
  max_completion_tokens?: number;  // Alias mapped to max_tokens upstream
  n?: number;
  seed?: number;
  stop?: string | string[];

  // Sampling
  top_p?: number;
  top_k?: number;
  frequency_penalty?: number;      // Range: [-2, 2]
  presence_penalty?: number;       // Range: [-2, 2]
  repetition_penalty?: number;     // Range: (0, 2]
  min_p?: number;                  // Range: [0, 1]
  top_a?: number;                  // Range: [0, 1]

  // Token probabilities
  logit_bias?: Record<number, number>;
  logprobs?: boolean;
  top_logprobs?: number;

  // Stable end-user identifier for abuse prevention
  user?: string;

  // Tool calling
  tools?: Tool[];
  tool_choice?: ToolChoice;
  parallel_tool_calls?: boolean;

  // Structured output
  response_format?: ResponseFormat;
  structured_outputs?: boolean;

  // Plugin configuration — forwarded to upstreams that support plugins.
  plugins?: Plugin[];

  // Multimodal and image-generation options
  modalities?: Array<"text" | "image">;
  image_config?: Record<string, unknown>;
  input_audio?: InputAudio;

  // Provider-specific reasoning controls
  reasoning_effort?: "low" | "medium" | "high";
  reasoning?: ReasoningConfig;
  thinking?: ThinkingConfig;
  enable_thinking?: boolean;

  // BazaarLink message transforms and fallback routing
  transforms?: Array<"middle-out">;
  models?: string[];             // Fallback list — this drives waterfall routing, not route
  route?: "fallback";            // Passthrough only; forwarded as-is, no local effect
  provider?: ProviderPreferences;
};

// Message types
type Message =
  | SystemMessage
  | UserMessage
  | AssistantMessage
  | ToolMessage;

type SystemMessage = {
  role: "system";
  content: string | ContentPart[];
  name?: string;
};

type UserMessage = {
  role: "user";
  content: string | ContentPart[];
  name?: string;
};

type AssistantMessage = {
  role: "assistant";
  content?: string | ContentPart[] | null;
  name?: string;
  tool_calls?: ToolCall[];
};

type ToolMessage = {
  role: "tool";
  content: string;
  tool_call_id: string;
  name?: string;
};

// Multimodal content parts
type ContentPart =
  | TextContentPart
  | ImageContentPart
  | FileContentPart
  | AudioContentPart
  | VideoContentPart;

type TextContentPart = {
  type: "text";
  text: string;
};

type ImageContentPart = {
  type: "image_url";
  image_url: {
    url: string;                    // Remote URL or base64 data URI
    detail?: string;
  };
};

type FileContentPart = {
  type: "file";
  file: {
    filename?: string;
    file_data: string;              // Base64 data URI
  };
};

type AudioContentPart = {
  type: "input_audio";
  input_audio: InputAudio;
};

type InputAudio = {
  data: string;                     // Raw base64 without a data URI prefix
  format: string;                   // For example "wav" or "mp3"
};

type VideoContentPart = {
  type: "video_url";
  video_url: {
    url: string;                    // Remote URL or base64 data URI
  };
};

// Tool calling subtypes
type FunctionDescription = {
  name: string;
  description?: string;
  parameters: object;               // JSON Schema object
};

type Tool = {
  type: "function";
  function: FunctionDescription;
};

type ToolChoice =
  | "none"
  | "auto"
  | "required"
  | {
      type: "function";
      function: {
        name: string;
      };
    };

type ToolCall = {
  id: string;
  type: "function";
  function: {
    name: string;
    arguments: string;
  };
};

// Structured output
type ResponseFormat =
  | {
      type: "json_object";
    }
  | {
      type: "json_schema";
      json_schema: {
        name: string;
        strict?: boolean;
        schema: object;
      };
    };

// Upstream plugin configuration
type Plugin = {
  id: string;
  enabled?: boolean;
  [key: string]: unknown;
};

// Reasoning controls vary by model family
type ReasoningConfig = {
  effort?: "low" | "medium" | "high";
  max_tokens?: number;
  exclude?: boolean;
};

type ThinkingConfig = {
  type?: "enabled" | "disabled";
  budget_tokens?: number;
};

// Provider routing preferences
type ProviderPreferences = {
  order?: string[];
  only?: string[];
  ignore?: string[];
  allow_fallbacks?: boolean;
  sort?:
    | "price"
    | "latency"
    | "throughput"
    | {
        by: string;
        partition?: string;
      };
  require_parameters?: boolean;
  data_collection?: "allow" | "deny";
  quantizations?: string[];
  max_price?: Record<string, number>;
};

예제 요청

curl https://bazaarlink.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $BAZAARLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4.1",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Explain quantum computing in one paragraph."}
    ],
    "temperature": 0.7,
    "max_tokens": 512
  }'

응답

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1740000000,
  "model": "openai/gpt-4.1",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Quantum computing leverages quantum mechanics..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 28,
    "completion_tokens": 74,
    "total_tokens": 102,
    "cost": 0.0006480,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    }
  }
}

응답 스키마 (TypeScript)

BazaarLink는 정확히 두 개의 필드만 정규화합니다 — model과 provider 필드 제거 — 나머지 업스트림 응답은 그대로 전달합니다. native_finish_reason, system_fingerprint, reasoning 같은 필드는 해당 업스트림 공급자가 값을 채운 경우에만 존재합니다 — 모든 모델에서 항상 존재한다고 가정하지 마세요. usage.cost는 예외로, 업스트림에서 전달된 값이 아니라 항상 BazaarLink 자체가 정산·청구한 금액입니다.

type Response = {
  id: string;
  object: "chat.completion" | "chat.completion.chunk";
  created: number;                 // Unix timestamp
  model: string;
  choices: (NonStreamingChoice | StreamingChoice)[];
  usage?: ResponseUsage;
  cost?: number;                   // Total cost in USD
};

type NonStreamingChoice = {
  index: number;
  finish_reason: "stop" | "length" | "tool_calls" | "content_filter" | null;
  native_finish_reason: string | null;  // Provider's original finish reason
  message: {
    role: "assistant";
    content: string | null;
    tool_calls?: ToolCall[];
  };
};

type StreamingChoice = {
  index: number;
  finish_reason: string | null;
  native_finish_reason: string | null;  // Provider's original finish reason
  delta: {
    role?: string;
    content?: string | null;
    tool_calls?: ToolCall[];
  };
};

type ResponseUsage = {
  prompt_tokens: number;
  completion_tokens: number;
  total_tokens: number;
  cost: number;                      // Total cost for this request in USD
  prompt_tokens_details?: {
    cached_tokens: number;           // Tokens served from prompt cache (reduced cost)
    cache_write_tokens?: number;     // Tokens written to cache in this request
    audio_tokens?: number;
  };
  completion_tokens_details?: {
    reasoning_tokens?: number;       // Thinking/reasoning tokens (e.g. o3, Qwen3, DeepSeek R1)
    image_tokens?: number;
  };
};

type ToolCall = {
  id: string;
  type: "function";
  function: { name: string; arguments: string };
};

이미지 생성

DALL·E 및 GPT-4o 같은 모델을 사용하여 텍스트 프롬프트에서 이미지를 생성합니다. `modalities` 파라미터를 사용하여 채팅 완성 엔드포인트에서 이미지 출력을 요청합니다. 이미지 편집(기존 이미지 수정)은 POST /v1/images/edits를 사용합니다 —— OpenAI images.edit 호환이며, multipart/form-data로 소스 이미지를 업로드합니다. 편집 가능한 모델은 modality가 text+image->image입니다(예: qwen/qwen-image-edit). 순수 생성 모델은 text->image입니다 —— 각 모델의 modality는 GET /v1/models에서 확인하세요.

Response format

/api/v1/images/generations는 기본적으로 OpenAI 호환 동기 JSON을 반환합니다(2026-07-25부터) — client.images.generate()가 래퍼 없이 바로 동작합니다. stream: true를 전달하면 SSE 이벤트 스트림으로 전환되어 생성 시간이 긴 모델의 진행 상황을 받을 수 있습니다.

A. /v1/chat/completions (네이티브, 권장)

POST/api/v1/chat/completions

The canonical streaming path. Recommended for any new integration.

curl -N https://bazaarlink.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $BL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.4-image-2",
    "messages": [{"role":"user","content":"a red cat on a sofa"}],
    "modalities": ["image","text"],
    "stream": true
  }'

이미지-투-이미지: content 배열에 image_url 파트를 포함하세요. 데이터 URI 또는 https 이미지 URL(http:// 는 거부됨)을 지원하며, 최대 8장, 데이터 URI당 약 10MB입니다. 이미지를 포함한 메시지에는 text 파트(편집 지시)도 함께 있어야 합니다. 일부 모델은 image_config(예: {"strength": 0.7}, 0–1 — 낮을수록 원본 이미지에 가까움)를 추가로 지원하며, 그대로 업스트림에 전달됩니다.

curl -N https://bazaarlink.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $BL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.4-image-2",
    "messages": [{"role":"user","content":[
      {"type":"image_url","image_url":{"url":"data:image/png;base64,..."}},
      {"type":"text","text":"change the background to a night city"}
    ]}],
    "modalities": ["image"],
    "stream": true
  }'

이미지 편집 (OpenAI 호환)

POST/api/v1/images/edits

OpenAI SDK의 client.images.edit()가 그대로 동작합니다(multipart 업로드, data: [{ url }] 을 반환하는 동기 JSON 응답). 제한은 이미지-투-이미지와 동일: 최대 8장, 각 10MB. mask와 response_format=b64_json은 아직 지원되지 않습니다.

curl https://bazaarlink.ai/api/v1/images/edits \
  -H "Authorization: Bearer $BL_API_KEY" \
  -F model="openai/gpt-5.4-image-2" \
  -F image=@cat.png \
  -F prompt="change the background to a night city"

B. /v1/images/generations (DALL·E 호환)

POST/api/v1/images/generations

OpenAI DALL-E request shape. Sync JSON ({ created, data: [{ url }] }) is the default and works with client.images.generate() out of the box; pass stream: true to get the SSE event stream documented below instead.

curl https://bazaarlink.ai/api/v1/images/generations \
  -H "Authorization: Bearer $BL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-image-2",
    "prompt": "a red cat on a sofa",
    "size": "1024x1024"
  }'
model필수
string
모델 ID, 예: google/gemini-2.5-flash-image
prompt필수
string
텍스트 프롬프트
size
string
출력 크기 (자동 매핑)
n
integer
생성 개수 (기본값 1)
# Streaming variant — progressive delivery for long generations
curl -N https://bazaarlink.ai/api/v1/images/generations \
  -H "Authorization: Bearer $BL_API_KEY" \
  -H "Accept: text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5.4-image-2","prompt":"a red cat on a sofa","stream":true}'

SSE event protocol

Both endpoints emit the same event types:

event: heartbeat        # every 60 s, keeps Cloudflare happy
data: {}

event: image            # upstream URL, fastest path
data: {"index": 0, "url": "https://upstream/a.png"}

event: image-cached     # bazaarlink Redis-backed proxy URL (1 hr TTL)
data: {"index": 0, "url": "https://bazaarlink.ai/api/v1/images/proxy/<token>"}

event: usage            # final cost / token count
data: {"promptTokens": 12, "completionTokens": 7080, "cost": 0.226, "durationMs": 163400, "imageCount": 1}

event: done
data: {}

지원되는 이미지 모델

Model IDModalityi2i (edits)

비디오 생성

비동기 3단계 플로우(submit → poll → content)입니다. 비디오 생성은 30초~5분이 걸려 chat-completions의 동기 요청/응답 방식에 맞지 않습니다 — 그래서 BazaarLink는 비디오를 전용 /api/v1/videos 경로로 분리하고 job-id 패턴을 사용합니다: submit으로 vjob_* ID 수신 → 상태 poll → 완료 후 bytes fetch. video model을 /chat/completions 또는 /images/generations로 호출하면 400(code: wrong_endpoint_for_video)이 반환됩니다. 비용은 completed 시점에 실제 usage.cost로 정산됩니다.

동영상 작업 유형

하나의 엔드포인트가 여러 작업을 처리합니다. 실제로 어떤 작업이 실행되는지는 전송하는 필드로 결정됩니다 —— 하나의 모델로 이미지-투-비디오, 키프레임, 이어 붙이기를 모두 할 수 있습니다. 모든 모델이 모든 작업을 지원하지는 않으며, 미지원 요청은 400을 반환합니다.

텍스트→동영상
prompt
텍스트 프롬프트만으로 생성하며, 입력 미디어가 필요 없습니다.
이미지→동영상
frame_images: [ first frame ]
이미지 자체가 화면입니다. 첫 프레임이 되어 움직이며 원본에 충실합니다. 예: 고양이 사진 → 같은 장면에서 그 고양이가 고개를 돌립니다.
키프레임(첫+마지막)
frame_images: [ first, last ]
시작 이미지와 끝 이미지를 주면 모델이 그 사이의 움직임을 보간합니다.
이어 붙이기
input_video
기존 클립을 연장합니다. 요청한 duration은 원본 동영상 길이보다 커야 합니다.
참조→동영상
input_references: [ images ]
이미지는 프레임이 아니라 '참조'입니다. 모델은 피사체/스타일을 유지하면서 완전히 새로운 장면을 생성합니다. 예: 고양이 사진 + "숲에서 춤추기" → 고양이의 모습은 유지되지만 장면과 움직임은 새로운 영상(참조 1~9장). 이미지→동영상과의 차이: i2v는 원본 이미지에 충실하고, r2v는 피사체를 새 영상으로 다시 연출합니다.
동영상 편집
input_video + prompt
기존 동영상을 편집합니다 — 장면, 스타일, 움직임 변경. 입력 동영상 초 + 출력 초로 과금됩니다.

1. 작업 제출 (즉시 vjob_xxx 반환)

POST/api/v1/videos
model필수
string
모델 ID, 예: alibaba/wan2.7-t2v
prompt필수
string
텍스트 프롬프트
duration
integer
초 단위 길이 (모델 제한에 따름)
resolution
string
해상도: 480p / 720p / 1080p 등
generate_audio
boolean
오디오 트랙 생성 여부 (true/false)
frame_images
array
첫/마지막 프레임 이미지(이미지→동영상, 키프레임). 객체 { type: "image_url", image_url: { url }, frame_type: "first_frame" | "last_frame" } 또는 순수 URL 문자열.
input_references
array
참조→동영상용 참조 이미지 —— 피사체/스타일 유도이며 정확한 프레임이 아닙니다.
input_video
string|object
이어 붙이기와 동영상 편집의 원본 동영상 URL. 업스트림에서 공개적으로 가져올 수 있어야 합니다.
aspect_ratio
string
화면 비율, 예: 16:9 또는 9:16. 입력 이미지가 비율을 결정하면 무시됩니다.
watermark
boolean
워터마크를 추가합니다. 기본값 false.
callback_url
string
작업이 최종 상태에 도달하면 호출되는 webhook URL — HTTPS만 가능, SSRF 검사 포함. v1에는 서명이 없으며, 힌트로 취급하고 GET /videos/{id}로 확인하세요.
curl https://bazaarlink.ai/api/v1/videos \
  -H "Authorization: Bearer $BL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "alibaba/wan2.7-t2v",
    "prompt": "a bird flying over mountains",
    "duration": 3,
    "resolution": "720p",
    "generate_audio": false
  }'
# → 202 { "id": "vjob_xxx", "status": "pending" }
Note
Submit 시 최악의 경우 × duration × multiplier로 선차감하고, completed 시 업스트림이 반환한 usage.cost로 차액을 정산/환불합니다.

2. 상태 폴링

GET/api/v1/videos/{id}
curl -H "Authorization: Bearer $BL_API_KEY" \
  https://bazaarlink.ai/api/v1/videos/vjob_xxx
Note
각 GET 요청은 8초 이상 간격을 두어야 실제로 업스트림에 도달합니다 (레이트 리밋 방지)
Note
status=failed인 경우 reserve 금액 전액이 사용자에게 환불됩니다.

3. 비디오 콘텐츠 가져오기 (MP4)

GET/api/v1/videos/{id}/content
curl -H "Authorization: Bearer $BL_API_KEY" \
  -o output.mp4 \
  https://bazaarlink.ai/api/v1/videos/vjob_xxx/content

알아두면 좋은 점

  • 허용 해상도는 모델마다 다릅니다 —— 미지원 값을 보내면 지원 값을 나열한 400을 반환합니다.
  • 입력 이미지/동영상은 공개 URL에서 접근 가능해야 합니다. 핫링크 보호된 호스트(일부 wiki 등)는 실패합니다.
  • 입력 미디어는 업스트림 콘텐츠 검열을 거치며 가끔 거부될 수 있습니다.
  • 이어 붙이기의 경우 요청한 duration이 원본 동영상 길이를 초과해야 합니다.
  • 출력 화면 비율은 입력 이미지를 따릅니다 —— 정사각형 이미지는 정사각형 동영상이 됩니다.
  • 동영상 편집은 입력 동영상의 초와 생성된 출력의 초로 과금됩니다.
  • 편집/이어 붙이기의 input_video는 공개 URL이어야 합니다. 여기서 생성한 동영상은 API 키 뒤에서 제공되므로 업스트림이 가져올 수 없습니다 —— 소스 동영상을 공개적으로 접근 가능한 URL에 호스팅하세요.
  • 웹훅 페이로드는 서명되지 않습니다 — 조치 전에 GET /videos/{id}로 상태/금액을 확인하세요. 거기의 unsigned_urls는 절대 경로입니다(폴링 응답의 상대 경로와 다름).

지원되는 비디오 모델

Model IDModalityTasks
bytedance/seedance-2.0text+image+audio+video->videot2v, i2v
bytedance/seedance-2.0-fasttext+image+audio+video->videot2v, i2v
google/veo-3.1text+image->videot2v, i2v
openai/sora-2-protext+image->videot2v, i2v
bytedance/seedance-1-5-protext+image->videot2v, i2v
alibaba/happyhorse-1.0text->videot2v
alibaba/wan2.6-r2v-flashtext+image+video->videor2v
alibaba/wan2.5-i2v-previewtext+image->videoi2v
alibaba/happyhorse-1.1text->videot2v
alibaba/wan2.7-t2vtext->videot2v
alibaba/wan2.7-i2vtext+image+video->videoi2v, kf2v, continuation
alibaba/wan2.6-t2vtext->videot2v
alibaba/wan2.5-t2v-previewtext->videot2v
alibaba/wan2.2-t2v-plustext->videot2v
alibaba/wan2.7-r2vtext+image+video->videor2v
alibaba/wan2.1-t2v-plustext->videot2v
alibaba/wan2.1-t2v-turbotext->videot2v
alibaba/wan2.6-i2v-flashtext+image->videoi2v
alibaba/wan2.2-i2v-flashtext+image->videoi2v
alibaba/wan2.7-videoedittext+image+video->videovideoedit
alibaba/wan2.6-i2vtext+image->videoi2v
alibaba/wan2.2-i2v-plustext+image->videoi2v
alibaba/wan2.6-r2vtext+image+video->videor2v

비디오 입력

동영상 입력을 지원하는 모델에 동영상 파일을 전송하여 분석, 캡션 생성, 장면 및 이벤트에 대한 질문에 답하게 합니다. 직접 URL 또는 base64 데이터 URI를 사용할 수 있습니다 — URL은 공개적으로 접근 가능한 동영상에 효율적이며, base64는 로컬 파일이나 비공개 동영상에 사용합니다.

지원 형식

MP4(H.264)MPEGMOVWebM
response = client.chat.completions.create(
    model="google/gemini-2.5-flash",
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "video_url",
                "video_url": {"url": "https://example.com/video.mp4"},
            },
            {"type": "text", "text": "What is happening in this video?"},
        ],
    }],
)

전체 API 레퍼런스 →

PDF 입력

PDF를 네이티브로 지원하는 모델(Claude, Gemini 등)에 메시지로 PDF 문서를 직접 전송할 수 있습니다. BazaarLink는 파일을 그대로 모델에 전달합니다 — 일반 input tokens로 과금, 추가 비용이나 추가 처리 없음.

지원 형식

  • PDF 문서 (텍스트, 이미지, 테이블, 스캔)
  • Base64 인코딩 데이터 URL (`data:application/pdf;base64,...`)
  • 다중 페이지 문서
  • 비밀번호 없는 PDF만
import base64

with open("document.pdf", "rb") as f:
    pdf_data = base64.b64encode(f.read()).decode()

response = client.chat.completions.create(
    model="anthropic/claude-sonnet-4.6",
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "file",
                "file": {
                    "filename": "document.pdf",
                    "file_data": f"data:application/pdf;base64,{pdf_data}",
                },
            },
            {"type": "text", "text": "Summarize this document."},
        ],
    }],
)

Responses API

상태 비저장 멀티턴 대화, 도구 호출, 멀티모달 입력을 위한 OpenAI Responses API 호환 엔드포인트. client.responses.create()를 사용하는 OpenAI Python SDK ≥ 1.x 에이전트 및 프레임워크에 적합합니다.

POST/api/v1/responses
Note
채팅 완성과 동일한 인증 및 모델 라우팅을 지원합니다.

요청 바디

model필수
string
모델 ID, 예: "openai/gpt-4o" 또는 "anthropic/claude-3.5-sonnet"
input필수
string | Item[]
사용자 입력 — 일반 문자열(단일 메시지) 또는 멀티턴/멀티모달 대화를 위한 입력 항목 배열.
instructions
string
시스템 수준 지시사항, 시스템 메시지와 동일. 매 요청마다 다시 보내야 합니다.
stream
boolean
true이면 Responses API SSE 스트림 이벤트를 반환합니다. 이벤트 유형: response.created, response.output_text.delta, response.completed.
max_output_tokens
integer
생성할 최대 출력 토큰 수 (o-시리즈 모델의 경우 추론 토큰 포함).
temperature
number
샘플링 온도 0–2. 높을수록 무작위. 기본값: 1
top_p
number
핵 샘플링 확률 질량. 기본값: 1
tools
Tool[]
도구(함수) 정의 — Chat Completions와 동일한 JSON Schema 형식(평면 Responses 형식과 중첩 형식 모두 허용). OpenAI 자체의 내장 호스팅 도구(web_search_preview, file_search, computer_use_preview)는 지원되지 않습니다. 웹 검색은 plugins: [{id:"web"}]로 사용할 수 있으며 — 일부 모델 라우트에서만 지원됩니다.
tool_choice
string | object
도구 사용 제어: "auto", "none", 또는 특정 도구
parallel_tool_calls
boolean
도구 제공 시 병렬 함수 호출 활성화. 기본값: true. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.
response_format
object
구조화된 JSON 출력 강제. 구조화된 출력 섹션 참조
models
string[]
장애 복구 모델 목록 — BazaarLink이 기본 모델 실패 시 순서대로 시도
transforms
string[]
적용할 메시지 변환, 예: ["middle-out"]. ≤8k 컨텍스트 모델에서 자동 적용하려면 생략
previous_response_id
string
이 엔드포인트는 상태 비저장입니다 — null이 아닌 값을 전달하면 즉시 400(invalid_prompt)을 반환하며, 절대 수락된 후 무시되지 않습니다. 대신 상태 비저장 모드를 사용하세요: input 배열에 전체 대화 기록을 전달하세요.
provider
object
고급 라우팅 설정 — 대부분의 사용자에게는 필요하지 않습니다.

요청 스키마 (TypeScript)

type ResponsesRequest = {
  model: string;                    // "provider/model-name"
  input: string | InputItem[];      // string or multi-turn array

  // Optional
  instructions?: string;            // System-level message
  stream?: boolean;                 // Default: false
  max_output_tokens?: number;
  temperature?: number;             // Range: [0, 2], default: 0.7
  top_p?: number;
  tools?: Tool[];
  tool_choice?: "auto" | "none" | "required" | object;
  parallel_tool_calls?: boolean;    // Default: true
  previous_response_id?: string;    // Not supported — use full input array
  provider?: ProviderPreferences;   // Same as Chat Completions
};

type InputItem =
  | { type?: "message"; role: "user" | "assistant" | "system" | "developer"; content: string | ContentBlock[] }
  | { type: "function_call_output"; call_id: string; output: string }   // tool result
  | { type: "function_call"; call_id: string; name: string; arguments: string };

type ContentBlock =
  | { type: "input_text"; text: string }
  | { type: "input_image"; image_url: string; detail?: "auto" | "low" | "high" };

예제 요청

curl https://bazaarlink.ai/api/v1/responses \
  -H "Authorization: Bearer $BAZAARLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o-mini",
    "instructions": "You are a helpful assistant.",
    "input": "What is the capital of Taiwan?"
  }'

응답 형식

// Non-streaming response object
type ResponsesResponse = {
  id: string;             // "resp_..."
  object: "response";
  created_at: number;
  completed_at: number;
  status: "completed" | "failed" | "incomplete";
  model: string;
  output: OutputItem[];
  usage: {
    input_tokens: number;   // equivalent to prompt_tokens
    output_tokens: number;  // equivalent to completion_tokens
    total_tokens: number;
    cost?: number;          // actual cost in credits
  } | null;
  error: null | { code: string; message: string };
};

type OutputItem =
  | {
      type: "message";
      id: string;
      role: "assistant";
      status: "completed";
      content: Array<{ type: "output_text"; text: string; annotations: [] }>;
    }
  | { type: "function_call"; id: string; call_id: string; name: string; arguments: string; status: "completed" };

채팅 완성에서 마이그레이션

messages를 input(문자열 또는 배열)으로 바꾸고, system-role 메시지 대신 instructions를 사용하며, choices[0].message.content 대신 output[0].content[0].text를 읽으세요.

# Chat Completions (before)
response = client.chat.completions.create(
    model="openai/gpt-4o-mini",
    messages=[
        {"role": "system", "content": "You are helpful."},
        {"role": "user",   "content": "Hello"},
    ]
)
text = response.choices[0].message.content

# Responses API (after)
response = client.responses.create(
    model="openai/gpt-4o-mini",
    instructions="You are helpful.",
    input="Hello"
)
text = response.output[0].content[0].text

제한 사항

  • previous_response_id 또는 store: true는 400(오류 코드 invalid_prompt)으로 거부됩니다 — 수락된 후 무시되는 것이 아닙니다. 항상 상태 비저장 모드를 사용해 input 배열에 전체 대화 기록을 전달하세요.
  • OpenAI 자체의 내장 호스팅 도구(web_search_preview, file_search, computer_use_preview)는 지원되지 않습니다. 웹 검색은 plugins: [{id:"web"}]로 사용할 수 있으며 — 일부 모델 라우트에서만 지원됩니다.
  • background: true는 수락되지만 무시됩니다 — 모든 요청은 완료될 때까지 동기적으로 실행됩니다.

Messages (Anthropic 호환)

Anthropic Claude SDK 호환 Messages API. Anthropic 공식 API와 동일하게 사용 — base URL과 auth header만 변경하세요.

POST/api/v1/messages
Note
Bearer token 또는 x-api-key header 지원 (Anthropic SDK 호환). 최대 body 크기: 10 MB.

요청 바디

model필수
string
모델 ID, 예: "openai/gpt-4o" 또는 "anthropic/claude-3.5-sonnet"
max_tokens필수
integer
생성할 최대 토큰 수 (양의 정수).
messages필수
Message[]
대화 메시지 배열 (비어 있지 않음).
system
string
선택적 system prompt.
stream
boolean
true이면 Server-Sent Events 스트림을 반환합니다. 기본값: false
temperature
number
샘플링 온도 0–2. 높을수록 무작위. 기본값: 1
top_p
number
핵 샘플링 확률 질량. 기본값: 1
top_k
integer
상위 K개로 토큰 선택 제한. 0 = 비활성화 (모두 고려). 기본값: 0
stop_sequences
string[]
사용자 정의 정지 시퀀스 문자열 배열.
tools
Tool[]
모델이 호출할 수 있는 도구(함수) 목록
tool_choice
string | object
도구 사용 제어: "auto", "none", 또는 특정 도구

예제 요청

from anthropic import Anthropic

client = Anthropic(
    base_url="https://bazaarlink.ai/api/v1",
    api_key="sk-bl-YOUR_KEY"
)

response = client.messages.create(
    model="anthropic/claude-opus-4",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}]
)
print(response.content[0].text)

응답

{
  "id": "msg_...",
  "type": "message",
  "role": "assistant",
  "model": "anthropic/claude-opus-4",
  "content": [
    { "type": "text", "text": "Hello! How can I help you today?" }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 10,
    "output_tokens": 12,
    "cache_read_input_tokens": 0,
    "cache_creation_input_tokens": 0,
    "bz_cost": 0.00042
  }
}

오류: 400 (검증 실패), 402 (크레딧 부족), 429 (rate limit), 502 (업스트림 오류/키 누락), 503 (서버 재시작).

모델

가격 및 기능 정보와 함께 사용 가능한 모든 모델을 나열합니다. 이 엔드포인트는 인증이 필요하지 않습니다.

GET/api/v1/models
# Text models (default)
curl https://bazaarlink.ai/api/v1/models

# Complete catalog
curl "https://bazaarlink.ai/api/v1/models?output_modalities=all"

응답

{
  "data": [
    {
      "id": "openai/gpt-4.1",
      "name": "GPT 4.1",
      "context_length": 1047576,
      "modality": "text+image+file->text",
      "pricing": {
        "prompt": "2.00",
        "completion": "8.00"
      }
    }
  ]
}
// /v1/models — Response Schema
type ModelsResponse = {
  data: Model[];
};

type Model = {
  id: string;                    // Model ID (e.g. "openai/gpt-4.1")
  name: string;                  // Human-readable name
  context_length: number | null; // Max context window in tokens
  modality: string | null;       // e.g. "text->text", "text+image->text"
  architecture?: {
    input_modalities?: string[];
    output_modalities?: Array<
      "text" | "image" | "embeddings" | "audio" |
      "video" | "rerank" | "speech" | "transcription"
    >;
  };
  pricing: {
    prompt: string;              // Input price per 1M tokens (USD)
    completion: string;          // Output price per 1M tokens (USD)
  };
  description?: string | null;   // Model description
  top_provider?: {
    max_completion_tokens?: number;
  };
  supported_parameters?: string[]; // e.g. ["tools", "response_format", "reasoning"]
  pricing_tiers?: {               // Present only for models with input-length tiers
    above_prompt_tokens: number;  // Ascending; strict "greater than" threshold
    prompt: string;                // USD per token, override tier
    completion: string;            // USD per token, override tier
  }[];
};

입력 길이 기반 단계별 가격

일부 모델은 프롬프트가 token 임계값을 초과하면 전체 가격표가 전환됩니다(임계값을 초과한 부분만이 아닙니다). 임계값은 엄격한 부등식입니다: 입력 token 수가 정확히 N이면 N 이하 단계가 적용되고, N을 초과할 때만 상위 단계가 적용됩니다.

pricing_tiers는 pricing과 동일한 레벨의 필드로, 기본 가격을 초과하는 오버라이드 단계가 있는 모델에만 존재합니다. 항목은 above_prompt_tokens 오름차순으로 정렬되며, prompt/completion은 token당 USD 가격입니다(pricing.prompt/pricing.completion과 동일한 단위). pricing.prompt와 pricing.completion은 항상 기본(최저) 단계입니다.

대부분의 모델에는 단계가 없습니다 — 이 경우 응답에 pricing_tiers 키 자체가 없습니다.

{
  "id": "openai/gpt-4.1",
  "name": "GPT 4.1",
  "pricing": {
    "prompt": "2.00",
    "completion": "8.00"
  },
  "pricing_tiers": [
    {
      "above_prompt_tokens": 128000,
      "prompt": "4.00",
      "completion": "16.00"
    }
  ]
}

사용 가능한 모델 (257)

다음은 BazaarLink에서 현재 사용 가능한 모델로, 데이터베이스에서 동적으로 로드됩니다:

OpenAI
openai/gpt-5.3-codex400K ctx · $1.75/$14.00text+image+file->text
openai/gpt-3.5-turbo-instruct4K ctx · $1.50/$2.00text->text
openai/gpt-5.4-nano400K ctx · $0.20/$1.25text+image+file->text
openai/gpt-5-codex400K ctx · $1.25/$10.00text+image->text
openai/text-embedding-ada-0028K ctx · $0.10/$0.00text->embeddings
openai/gpt-5.2-codex400K ctx · $1.75/$14.00text+image->text
openai/gpt-4-turbo-preview128K ctx · $10.00/$30.00text->text
openai/o4-mini200K ctx · $1.10/$4.40text+image+file->text
openai/o1-pro200K ctx · $150.00/$600.00text+image+file->text
openai/gpt-5.4-mini400K ctx · $0.75/$4.50text+image+file->text
openai/gpt-5.1400K ctx · $1.25/$10.00text+image+file->text
openai/o3-pro200K ctx · $20.00/$80.00text+image+file->text
openai/gpt-5.6-luna-pro1050K ctx · $1.00/$6.00text+image+file->text
openai/gpt-48K ctx · $30.00/$60.00text->text
openai/gpt-5.6-sol1050K ctx · $5.00/$30.00text+image+file->text
openai/gpt-4o-mini-2024-07-18128K ctx · $0.15/$0.60text+image+file->text
openai/gpt-5-mini400K ctx · $0.25/$2.00text+image+file->text
openai/gpt-5.6-luna1050K ctx · $1.00/$6.00text+image+file->text
openai/gpt-4o-2024-08-06128K ctx · $2.50/$10.00text+image+file->text
openai/o3-deep-research200K ctx · $10.00/$40.00text+image+file->text
openai/gpt-5.2-chat128K ctx · $1.75/$14.00text+image+file->text
openai/gpt-5.2400K ctx · $1.75/$14.00text+image+file->text
openai/gpt-5.1-chat128K ctx · $1.25/$10.00text+image+file->text
openai/o4-mini-deep-research200K ctx · $2.00/$8.00text+image+file->text
openai/text-embedding-3-small8K ctx · $0.02/$0.00text->embeddings
openai/gpt-4.1-nano1048K ctx · $0.10/$0.40text+image+file->text
openai/o3200K ctx · $2.00/$8.00text+image+file->text
openai/gpt-3.5-turbo16K ctx · $0.50/$1.50text->text
openai/gpt-5.51050K ctx · $5.00/$30.00text+image+file->text
openai/gpt-3.5-turbo-06134K ctx · $1.00/$2.00text->text
openai/gpt-4.11048K ctx · $2.00/$8.00text+image+file->text
openai/gpt-5-pro400K ctx · $15.00/$120.00text+image+file->text
openai/gpt-4.1-mini1048K ctx · $0.40/$1.60text+image+file->text
openai/gpt-oss-20b131K ctx · $0.03/$0.13text->text
openai/gpt-5.2-pro400K ctx · $21.00/$168.00text+image+file->text
openai/o4-mini-high200K ctx · $1.10/$4.40text+image+file->text
openai/gpt-3.5-turbo-16k16K ctx · $3.00/$4.00text->text
openai/gpt-4o-mini128K ctx · $0.15/$0.60text+image+file->text
openai/gpt-5.3-chat128K ctx · $1.75/$14.00text+image+file->text
openai/gpt-4o-2024-05-13128K ctx · $5.00/$15.00text+image+file->text
openai/gpt-oss-120b131K ctx · $0.15/$0.60text->text
openai/o3-mini200K ctx · $1.10/$4.40text+file->text
openai/gpt-4-turbo128K ctx · $10.00/$30.00text+image->text
openai/gpt-5.4-pro1050K ctx · $30.00/$180.00text+image+file->text
openai/text-embedding-3-large8K ctx · $0.13/$0.00text->embeddings
openai/gpt-5.41050K ctx · $2.50/$15.00text+image+file->text
openai/gpt-5.1-codex-max400K ctx · $1.25/$10.00text+image->text
openai/gpt-5-nano400K ctx · $0.05/$0.40text+image+file->text
openai/o1200K ctx · $15.00/$60.00text+image+file->text
openai/gpt-5.1-codex-mini400K ctx · $0.25/$2.00text+image->text
openai/gpt-5.6-terra-pro1050K ctx · $2.50/$15.00text+image+file->text
openai/gpt-5.6-terra1050K ctx · $2.50/$15.00text+image+file->text
openai/gpt-5400K ctx · $1.25/$10.00text+image+file->text
openai/gpt-5.6-sol-pro1050K ctx · $5.00/$30.00text+image+file->text
openai/gpt-5.1-codex400K ctx · $1.25/$10.00text+image->text
openai/o3-mini-high200K ctx · $1.10/$4.40text+file->text
openai/gpt-4o-2024-11-20128K ctx · $2.50/$10.00text+image+file->text
openai/sora-2-pro · $0.00/$0.00text+image->video
openai/gpt-4o128K ctx · $2.50/$10.00text+image+file->text
openai/gpt-oss-safeguard-20b131K ctx · $0.07/$0.30text->text
openai/gpt-5.4-image-2272K ctx · $8.00/$15.00text+image+file->text+image
openai/gpt-image-1400K ctx · $10.00/$10.00text+image->image
openai/gpt-image-2400K ctx · $8.00/$8.00text+image->image
openai/gpt-image-1-mini400K ctx · $2.50/$2.50text+image->image
Qwen
qwen/qwen3.7-plus1000K ctx · $0.32/$1.28text+image->text
qwen/qwen3.7-max1000K ctx · $1.48/$4.42text->text
qwen/qwen3.5-plus-02-151000K ctx · $0.26/$1.56text+image+video->text
qwen/qwen3-coder-flash1000K ctx · $0.20/$0.97text->text
qwen/qwen-2.5-coder-32b-instruct33K ctx · $0.66/$1.00text->text
qwen/qwen-plus1000K ctx · $0.26/$0.78text->text
qwen/qwen3.6-35b-a3b262K ctx · $0.14/$1.00text+image+video->text
qwen/qwen3-coder262K ctx · $0.30/$1.00text->text
qwen/qwen-plus-2025-07-281000K ctx · $0.26/$0.78text->text
qwen/qwen3-235b-a22b-2507262K ctx · $0.09/$0.55text->text
qwen/qwen3.5-plus-202604201000K ctx · $0.30/$1.80text+image+video->text
qwen/qwen3-embedding-4b33K ctx · $0.02/$0.00text->embeddings
qwen/qwen3-coder-30b-a3b-instruct262K ctx · $0.07/$0.27text->text
qwen/qwen-2.5-7b-instruct33K ctx · $0.04/$0.10text->text
qwen/qwen3-coder-plus1000K ctx · $0.65/$3.25text->text
qwen/qwen3-next-80b-a3b-instruct262K ctx · $0.10/$1.10text->text
qwen/qwen-2.5-72b-instruct33K ctx · $0.36/$0.40text->text
qwen/qwen-plus-2025-07-28:thinking1000K ctx · $0.40/$1.20text->text
qwen/qwen3-vl-235b-a22b-thinking131K ctx · $0.40/$4.00text+image->text
qwen/qwen3-vl-8b-thinking131K ctx · $0.18/$2.10text+image->text
qwen/qwen3-30b-a3b-instruct-2507262K ctx · $0.05/$0.19text->text
qwen/qwen3.5-flash-02-231000K ctx · $0.07/$0.26text+image+video->text
qwen/qwen3-vl-235b-a22b-instruct262K ctx · $0.21/$1.90text+image->text
qwen/qwen3.5-27b262K ctx · $0.20/$1.56text+image+video->text
qwen/qwen3-235b-a22b131K ctx · $0.46/$1.82text->text
qwen/qwen3.5-9b262K ctx · $0.10/$0.15text+image+video->text
qwen/qwen3-32b131K ctx · $0.08/$0.28text->text
qwen/qwen3-30b-a3b131K ctx · $0.13/$0.52text->text
qwen/qwen3-8b131K ctx · $0.12/$0.46text->text
qwen/qwen3-max-thinking262K ctx · $0.78/$3.90text->text
qwen/qwen3-vl-8b-instruct262K ctx · $0.12/$0.46text+image->text
qwen/qwen3.5-122b-a10b262K ctx · $0.26/$2.08text+image+video->text
qwen/qwen3-next-80b-a3b-thinking262K ctx · $0.15/$1.20text->text
qwen/qwen3-vl-30b-a3b-thinking262K ctx · $0.20/$2.40text+image->text
qwen/qwen2.5-vl-72b-instruct128K ctx · $0.80/$1.00text+image->text
qwen/qwen3-235b-a22b-thinking-2507262K ctx · $0.30/$3.00text->text
qwen/qwen3.5-35b-a3b262K ctx · $0.14/$1.00text+image+video->text
qwen/qwen3-coder-next262K ctx · $0.12/$0.80text->text
qwen/qwen3-max262K ctx · $0.78/$3.90text->text
qwen/qwen3-30b-a3b-thinking-250782K ctx · $0.20/$2.40text->text
qwen/qwen3-vl-30b-a3b-instruct262K ctx · $0.13/$0.52text+image->text
qwen/qwen3-vl-32b-instruct131K ctx · $0.10/$0.42text+image->text
qwen/qwen3-14b131K ctx · $0.23/$0.91text->text
qwen/qwen3.5-397b-a17b262K ctx · $0.39/$2.34text+image+video->text
qwen/qwen3.6-27b262K ctx · $0.29/$2.40text+image+video->text
qwen/qwen3.6-plus1000K ctx · $0.33/$1.95text+image+video->text
qwen/qwen3-embedding-8b33K ctx · $0.01/$0.00text->embeddings
qwen/qwen-image-maxtext->image
qwen/qwen-image-plustext->image
qwen/qwen-image-edittext+image->image
qwen/qwen-image-2.0-protext->image
qwen/qwen-image-edit-plustext+image->image
qwen/qwen-image-2.0text->image
qwen/qwen-imagetext->image
qwen/qwen-image-edit-maxtext+image->image
Alibaba
alibaba/wan2.7-image-protext->image
alibaba/happyhorse-1.0 · $0.00/$0.00text->video
alibaba/wan2.6-r2v-flash · $0.00/$0.00text+image+video->video
alibaba/wan2.2-t2i-flashtext->image
alibaba/wan2.1-t2i-plustext->image
alibaba/wan2.1-t2i-turbotext->image
alibaba/z-image-turbotext->image
alibaba/wan2.2-t2i-plustext->image
alibaba/wan2.6-imagetext->image
alibaba/wan2.5-i2v-preview · $0.00/$0.00text+image->video
alibaba/happyhorse-1.1 · $0.00/$0.00text->video
alibaba/wan2.7-t2v · $0.00/$0.00text->video
alibaba/wan2.7-i2v · $0.00/$0.00text+image+video->video
alibaba/wan2.6-t2v · $0.00/$0.00text->video
alibaba/wan2.5-t2v-preview · $0.00/$0.00text->video
alibaba/wan2.2-t2v-plus · $0.00/$0.00text->video
alibaba/wan2.7-r2v · $0.00/$0.00text+image+video->video
alibaba/wan2.1-t2v-plus · $0.00/$0.00text->video
alibaba/wan2.1-t2v-turbo · $0.00/$0.00text->video
alibaba/wan2.6-i2v-flash · $0.00/$0.00text+image->video
alibaba/wan2.2-i2v-flash · $0.00/$0.00text+image->video
alibaba/wan2.5-t2i-previewtext->image
alibaba/wan2.7-videoedit · $0.00/$0.00text+image+video->video
alibaba/wan2.6-i2v · $0.00/$0.00text+image->video
alibaba/wan2.5-i2i-previewtext+image->image
alibaba/wan2.2-i2v-plus · $0.00/$0.00text+image->video
alibaba/wan2.6-r2v · $0.00/$0.00text+image+video->video
alibaba/wan2.6-t2itext->image
alibaba/wan2.7-imagetext->image
Google
google/gemini-3.1-pro-preview1049K ctx · $2.00/$12.00text+image+file+audio+video->text
google/gemini-3.1-flash-lite-preview1049K ctx · $0.25/$1.50text+image+file+audio+video->text
google/gemini-2.5-flash-lite1049K ctx · $0.10/$0.40text+image+file+audio+video->text
google/gemma-3-4b-it131K ctx · $0.05/$0.10text+image->text
google/gemini-embedding-2-preview8K ctx · $0.20/$0.00text+image+file+audio+video->embeddings
google/gemini-2.5-flash-image33K ctx · $0.30/$2.50text+image->text+image
google/gemini-3.5-flash1049K ctx · $1.50/$9.00text+image+file+audio+video->text
google/gemini-2.5-pro-preview1049K ctx · $1.25/$10.00text+image+file+audio->text
google/gemma-3n-e4b-it33K ctx · $0.06/$0.12text->text
google/gemini-3.1-flash-image131K ctx · $0.50/$3.00text+image->text+image
google/gemini-2.5-flash1049K ctx · $0.30/$2.50text+image+file+audio+video->text
google/gemini-3-flash-preview1049K ctx · $0.50/$3.00text+image+file+audio+video->text
google/gemma-3-12b-it131K ctx · $0.05/$0.15text+image->text
google/gemma-2-27b-it8K ctx · $0.65/$0.65text->text
google/gemini-2.5-pro1049K ctx · $1.25/$10.00text+image+file+audio+video->text
google/gemma-4-31b-it262K ctx · $0.14/$0.40text+image+video->text
google/gemini-embedding-00120K ctx · $0.15/$0.00text->embeddings
google/gemini-2.5-pro-preview-05-061049K ctx · $1.25/$10.00text+image+file+audio+video->text
google/gemini-3.5-flash-lite1049K ctx · $0.30/$2.50text+image+file+audio+video->text
google/gemma-3-27b-it262K ctx · $0.08/$0.45text+image->text
google/veo-3.1 · $0.00/$0.00text+image->video
google/gemini-3-pro-image131K ctx · $2.00/$12.00text+image->text+image
google/gemini-3.1-pro-preview-customtools1049K ctx · $2.00/$12.00text+image+file+audio+video->text
google/gemma-4-26b-a4b-it262K ctx · $0.07/$0.34text+image+video->text
google/gemini-3.6-flash1049K ctx · $1.50/$7.50text+image+file+audio+video->text
google/gemini-3.1-flash-image-preview66K ctx · $0.50/$3.00text+image->text+image
Anthropic
anthropic/claude-opus-4.61000K ctx · $5.00/$25.00text+image+file->text
anthropic/claude-sonnet-4.61000K ctx · $3.00/$15.00text+image+file->text
anthropic/claude-sonnet-41000K ctx · $3.00/$15.00text+image+file->text
anthropic/claude-sonnet-51000K ctx · $2.00/$10.00text+image+file->text
anthropic/claude-haiku-4.5200K ctx · $1.00/$5.00text+image+file->text
anthropic/claude-sonnet-4.51000K ctx · $3.00/$15.00text+image+file->text
anthropic/claude-opus-4.71000K ctx · $5.00/$25.00text+image+file->text
anthropic/claude-fable-51000K ctx · $10.00/$50.00text+image+file->text
anthropic/claude-opus-4.81000K ctx · $5.00/$25.00text+image+file->text
anthropic/claude-3-haiku200K ctx · $0.25/$1.25text+image->text
anthropic/claude-opus-4.5200K ctx · $5.00/$25.00text+image+file->text
anthropic/claude-opus-4200K ctx · $15.00/$75.00text+image+file->text
anthropic/claude-opus-4.1200K ctx · $15.00/$75.00text+image+file->text
anthropic/claude-opus-51000K ctx · $5.00/$25.00text+image+file->text
Zhipu AI
z-ai/glm-4.7205K ctx · $0.40/$1.75text->text
z-ai/glm-5205K ctx · $1.00/$3.20text->text
z-ai/glm-5.1205K ctx · $1.40/$4.40text->text
z-ai/glm-5.21049K ctx · $1.40/$4.40text->text
z-ai/glm-5v-turbo203K ctx · $1.20/$4.00text+image+video->text
z-ai/glm-5-turbo203K ctx · $1.20/$4.00text->text
z-ai/glm-4.6v131K ctx · $0.30/$0.90text+image+video->text
z-ai/glm-4.6205K ctx · $0.50/$2.00text->text
z-ai/glm-4.7-flash203K ctx · $0.06/$0.40text->text
z-ai/glm-4.5-air131K ctx · $0.13/$0.85text->text
z-ai/glm-4.5131K ctx · $0.60/$2.20text->text
z-ai/glm-4.5v66K ctx · $0.60/$1.80text+image->text
DeepSeek
deepseek/deepseek-v3.2164K ctx · $0.28/$0.42text->text
deepseek/deepseek-v4-pro1049K ctx · $2.40/$4.80text->text
deepseek/deepseek-v4-flash1049K ctx · $0.20/$0.40text->text
deepseek/deepseek-v3.2-exp164K ctx · $0.27/$0.41text->text
deepseek/deepseek-r1164K ctx · $0.70/$2.50text->text
deepseek/deepseek-v3.1-terminus164K ctx · $0.27/$1.00text->text
deepseek/deepseek-chat-v3-0324164K ctx · $0.27/$1.12text->text
deepseek/deepseek-r1-0528164K ctx · $0.50/$2.15text->text
deepseek/deepseek-r1-distill-llama-70b8K ctx · $0.80/$0.80text->text
deepseek/deepseek-chat-v3.1164K ctx · $0.25/$0.95text->text
deepseek/deepseek-chat164K ctx · $0.40/$1.30text->text
Moonshot AI
moonshotai/kimi-k31049K ctx · $3.00/$15.00text+image->text
moonshotai/kimi-k2.7-code-highspeed · $1.90/$8.00
moonshotai/kimi-k2.7-code262K ctx · $0.95/$4.00text+image->text
moonshotai/kimi-k2.5262K ctx · $0.60/$3.00text+image->text
moonshotai/kimi-k2.6262K ctx · $0.86/$3.57text+image->text
moonshotai/kimi-k2131K ctx · $0.57/$2.30text->text
moonshotai/kimi-k2-0905262K ctx · $0.60/$2.50text->text
moonshotai/kimi-k2-thinking262K ctx · $0.60/$2.50text->text
xAI
x-ai/grok-4.202000K ctx · $1.25/$2.50text+image+file->text
x-ai/grok-4.20-multi-agent2000K ctx · $1.25/$2.50text+image+file->text
x-ai/grok-4.31000K ctx · $1.25/$2.50text+image+file->text
x-ai/grok-4.5500K ctx · $2.00/$6.00text+image+file->text
x-ai/grok-build-0.1256K ctx · $1.00/$2.00text+image+file->text
Perplexity
perplexity/sonar-pro200K ctx · $3.00/$15.00text+image->text
perplexity/sonar-reasoning-pro128K ctx · $2.00/$8.00text+image->text
perplexity/sonar127K ctx · $1.00/$1.00text+image->text
perplexity/sonar-deep-research128K ctx · $2.00/$8.00text->text
perplexity/sonar-pro-search200K ctx · $3.00/$15.00text+image->text
MiniMax
minimax/minimax-m2.7205K ctx · $0.30/$1.20text->text
minimax/minimax-m2.5205K ctx · $0.30/$1.20text->text
minimax/minimax-m31049K ctx · $0.30/$1.20text+image+video->text
minimax/minimax-m2.1205K ctx · $0.30/$1.20text->text
Tencent
tencent/kinfra-text-embedding-4b · $0.08/$0.00
tencent/hy3 · $0.13/$0.53
tencent/hy-mt2-plus · $0.10/$0.40
tencent/kinfra-text-embedding-0.6b · $0.07/$0.00
bytedance-seed
bytedance-seed/seed-2.0-mini262K ctx · $0.10/$0.40text+image+video->text
bytedance-seed/seed-1.6-flash262K ctx · $0.07/$0.30text+image+video->text
bytedance-seed/seed-1.6262K ctx · $0.25/$2.00text+image+video->text
bytedance-seed/seed-2.0-lite262K ctx · $0.25/$2.00text+image+video->text
Nous
nousresearch/hermes-3-llama-3.1-70b131K ctx · $0.70/$0.70text->text
nousresearch/hermes-3-llama-3.1-405b131K ctx · $1.00/$1.00text->text
nousresearch/hermes-4-70b131K ctx · $0.13/$0.40text->text
nousresearch/hermes-4-405b131K ctx · $1.00/$3.00text->text
ByteDance
bytedance/seedance-2.0 · $0.00/$0.00text+image+audio+video->video
bytedance/seedance-2.0-fast · $0.00/$0.00text+image+audio+video->video
bytedance/seedance-1-5-pro · $0.00/$0.00text+image->video
Mistral
mistralai/mistral-large128K ctx · $2.00/$6.00text+file->text
mistralai/mixtral-8x22b-instruct66K ctx · $2.00/$6.00text+file->text
NVIDIA
nvidia/nemotron-3-super-120b-a12b1000K ctx · $0.30/$0.90text->text
nvidia/nemotron-3-nano-30b-a3b262K ctx · $0.05/$0.20text->text
xiaomi
xiaomi/mimo-v2.51050K ctx · $0.14/$0.28text+image+audio+video->text
xiaomi/mimo-v2.5-pro1050K ctx · $0.43/$0.87text->text
ibm-granite
ibm-granite/granite-4.0-h-micro131K ctx · $0.02/$0.11text->text
Meta
meta-llama/llama-3.2-1b-instruct60K ctx · $0.03/$0.20text->text
Tongyi-MAI
Tongyi-MAI/Z-Image-Turbotext->image

다음에서 모든 모델을 탐색하세요 모델 페이지.

스트리밍

설정 stream: true 하여 Server-Sent Events(SSE) 스트림을 받으세요. 각 이벤트에는 응답 청크가 포함됩니다.

from openai import OpenAI

client = OpenAI(
    base_url="https://bazaarlink.ai/api/v1",
    api_key="sk-bl-YOUR_API_KEY",
)

stream = client.chat.completions.create(
    model="anthropic/claude-sonnet-4.6",
    messages=[{"role": "user", "content": "Count to 10 slowly."}],
    stream=True,
)

for chunk in stream:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="", flush=True)

SSE 형식

data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"Hello"},"index":0}]}

data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":" world"},"index":0}]}

data: {"id":"chatcmpl-abc","choices":[{"delta":{},"finish_reason":"stop","index":0}],"usage":{"prompt_tokens":10,"completion_tokens":4,"total_tokens":14}}

data: [DONE]
스트리밍에서의 사용량
스트리밍 시, 사용량 데이터는 [DONE] 메시지 이전의 마지막 청크에서 빈 delta와 finish_reason: "stop"을 가진 choices 배열과 함께 반환됩니다.

Keep-alive 및 마지막 청크

스트림에는 keep-alive로 SSE 주석 줄(콜론으로 시작)이나 하트비트 이벤트가 포함될 수 있습니다 — 원시 스트림을 그대로 JSON.parse하지 말고 data: 가 아닌 줄은 건너뛰세요. 마지막 data 청크는 data: [DONE] 전에 usage(토큰 수와 비용)를 담고 있습니다. 성공한 응답에는 X-Request-Id 헤더가 포함됩니다 — 문제를 보고할 때 함께 제공하세요.

: keepalive          <- SSE comment line — ignore, do NOT JSON.parse

data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"Hi"},"index":0}]}

data: {"id":"chatcmpl-abc","choices":[{"delta":{},"finish_reason":"stop","index":0}],"usage":{...}}

data: [DONE]

스트림 취소

클라이언트 연결을 종료하면 스트리밍 요청을 취소할 수 있습니다 — 예: AbortController.abort() 호출 또는 stream 객체 종료. BazaarLink는 취소 신호를 받는 즉시 이후 청크 전달을 중단하고 공급자로 나가는 요청을 취소합니다.

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://bazaarlink.ai/api/v1",
  apiKey: "sk-bl-YOUR_API_KEY",
});

const controller = new AbortController();

const stream = await client.chat.completions.create(
  {
    model: "anthropic/claude-sonnet-4.6",
    messages: [{ role: "user", content: "Write a long story." }],
    stream: true,
  },
  { signal: controller.signal }
);

for await (const chunk of stream) {
  const content = chunk.choices[0]?.delta?.content;
  if (content) process.stdout.write(content);
}

// e.g. on a "Stop" button click:
controller.abort();
중단된 스트림은 과금되지 않습니다
마지막 usage 청크가 도착하기 전에 스트림이 끝나면 — 클라이언트 측 취소를 포함해서 — 해당 요청의 신뢰할 수 있는 토큰 수 근거가 없으므로 BazaarLink는 예약된 금액 전액을 환불합니다. 취소 전에 클라이언트로 이미 전달된 내용에 대해서는 과금되지 않습니다.
공급자 측 즉시 중단은 보장되지 않습니다
연결을 종료하면 BazaarLink는 즉시 이후 토큰 전달과 과금을 중단하지만, 업스트림 공급자가 연결이 끊기는 순간 자사 서버에서 생성을 멈추는지 여부는 해당 공급자에 따라 다릅니다 — 일부는 연결 종료 후에도 잠시 계속 계산할 수 있습니다.

스트림 도중 오류

오류 프레임에는 choices 필드가 없음
스트리밍이 이미 시작된 후 실패가 발생하면(예: 업스트림 연결 끊김), 일반적인 {choices:[...]} 대신 {error:{message,type,code}} 형태의 SSE 데이터 프레임을 받게 됩니다 — 헤더는 이미 전송되었으므로 HTTP 상태 변경은 없습니다. choices[0].delta를 읽기 전에 error 키가 있는지 확인하세요. 이미 스트리밍된 토큰에 대해서만 과금됩니다(부분 과금 적용).
data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"The capital of "},"index":0}]}

data: {"error":{"message":"Upstream connection lost.","type":"upstream_error","code":502}}

data: [DONE]

임베딩

임베딩(Embeddings)은 의미를 포착하는 수치 표현으로, 텍스트를 벡터(숫자 배열)로 변환하여 다양한 머신러닝 작업에 활용할 수 있습니다. BazaarLink는 OpenAI 임베딩 API와 호환되는 통합 엔드포인트를 제공하여 하나의 인터페이스로 여러 공급자의 임베딩 모델을 호출할 수 있습니다.

임베딩이란?

임베딩은 텍스트를 고차원 벡터로 변환하며, 의미적으로 유사한 텍스트는 벡터 공간에서 더 가깝게 위치합니다——예를 들어 "고양이"와 "새끼 고양이"의 임베딩은 비슷하지만, "고양이"와 "비행기"는 멀리 떨어져 있습니다. 이러한 벡터 표현 덕분에 기계가 텍스트 간의 관계를 이해할 수 있으며, 많은 AI 애플리케이션의 기반이 됩니다.

일반적인 사용 사례

사용 사례
설명
RAG (검색 증강 생성)답변을 생성하기 전에 지식 베이스에서 관련 컨텍스트를 검색하는 시스템을 구축——임베딩은 LLM 컨텍스트에 포함할 가장 관련성 높은 문서를 찾아줍니다.
시맨틱 검색문서와 쿼리를 임베딩으로 변환한 후 벡터 유사도로 가장 관련성 높은 문서를 찾습니다——키워드 일치만이 아니라 의미를 이해하므로 키워드 검색보다 더 나은 결과를 제공합니다.
추천 시스템상품, 기사, 동영상 등의 항목과 사용자 선호도에 대한 임베딩을 생성하여 유사한 항목을 추천——공통 키워드가 없어도 벡터 비교로 의미적으로 관련된 항목을 찾을 수 있습니다.
클러스터링 및 분류임베딩 패턴을 분석하여 유사한 문서를 그룹화하거나 분류——임베딩이 비슷한 문서는 보통 같은 주제나 카테고리에 속합니다.
중복 감지임베딩 유사도를 비교하여 중복 또는 거의 중복된 콘텐츠를 감지——내용이 바꿔 표현되었더라도 감지할 수 있습니다.
이상 감지데이터셋의 일반적인 패턴에서 크게 벗어난 임베딩을 찾아 이상치나 특이한 콘텐츠를 식별합니다.
POST/api/v1/embeddings
Note
모든 업스트림 공급자가 임베딩을 지원하는 것은 아닙니다. 구성된 공급자가 요청된 모델을 지원하지 않으면 BazaarLink이 자동으로 다음 사용 가능한 공급자로 장애 복구합니다.

매개변수

model필수
string
사용할 임베딩 모델, 예: "openai/text-embedding-3-small".
input필수
string | string[] | ContentItem[]
임베딩할 텍스트 — 단일 문자열, 한 번의 배치 호출을 위한 문자열 배열, 또는 (지원하는 모델의 경우) text와 image_url 파트를 섞은 {content:[...]} 항목 배열.
dimensions
integer
요청하는 출력 벡터 크기. 가변 차원을 지원하는 모델(예: OpenAI text-embedding-3 계열)에서만 적용됩니다. 업스트림 공급자에 그대로 전달되며, 지원하지 않는 모델에서는 무시됩니다.
encoding_format
string
요청하는 임베딩 인코딩, 예: "float" 또는 "base64". 업스트림 공급자에 그대로 전달됩니다 — 지원 여부는 모델에 따라 다릅니다.
provider
object
공급자 라우팅 설정 — order, allow_fallbacks, data_collection 및 Provider Selection에 설명된 기타 필드.

기본 요청

from openai import OpenAI

client = OpenAI(
    base_url="https://bazaarlink.ai/api/v1",
    api_key="sk-bl-YOUR_API_KEY",
)

response = client.embeddings.create(
    model="openai/text-embedding-3-small",
    input="The quick brown fox jumps over the lazy dog",
)

print(response.data[0].embedding)  # 1536-dimensional vector

배치 처리

문자열 배열을 보내면 한 번의 요청으로 여러 텍스트를 임베딩할 수 있습니다 — 텍스트별로 호출하는 것보다 저렴하고 빠릅니다.

response = client.embeddings.create(
    model="openai/text-embedding-3-small",
    input=[
        "Machine learning is a subset of artificial intelligence",
        "Deep learning uses neural networks with multiple layers",
        "Natural language processing enables computers to understand text",
    ],
)

for i, item in enumerate(response.data):
    print(f"Embedding {i}: {len(item.embedding)} dimensions")

멀티모달 입력 (이미지 + 텍스트)

이미지 입력을 지원하는 모델(output_modalities에 "embeddings", inputModalities에 "image" 포함)은 {content:[{type:"text",...}, {type:"image_url",...}]} 형태의 입력 항목을 받아, 이미지 단독 또는 텍스트와 함께 임베딩할 수 있습니다.

모델에 따라 다름
일부 임베딩 모델만 이미지 입력을 받습니다 — image_url 콘텐츠를 보내기 전에 Models 페이지에서 해당 모델의 지원 모달리티를 확인하세요. 텍스트 전용 모델은 이 형식을 거부합니다.
import requests

response = requests.post(
    "https://bazaarlink.ai/api/v1/embeddings",
    headers={
        "Authorization": "Bearer sk-bl-YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "google/gemini-embedding-2-preview",
        "input": [{
            "content": [
                {"type": "text", "text": "A scenic boardwalk through a green meadow"},
                {"type": "image_url", "image_url": {"url": "https://example.com/boardwalk.jpg"}},
            ]
        }],
        "encoding_format": "float",
    },
)

embedding = response.json()["data"][0]["embedding"]
print(f"Embedding dimension: {len(embedding)}")

공급자 라우팅

채팅 완성과 동일한 방식으로 어느 업스트림이 임베딩 요청을 처리할지 제어할 수 있습니다 — 전체 필드 참조는 Provider Selection을 확인하세요.

{
  "model": "openai/text-embedding-3-small",
  "input": "Your text here",
  "provider": {
    "order": ["openai"],
    "allow_fallbacks": true,
    "data_collection": "deny"
  }
}

임베딩 모델 찾기

임베딩 전용 모델 목록 엔드포인트는 없습니다 — GET /api/v1/models를 호출한 뒤 output_modalities에 "embeddings"가 포함된 항목을 클라이언트 측에서 필터링하거나, Models 페이지를 둘러보세요.

제한사항

  • 스트리밍 미지원 — 채팅 완성과 달리 임베딩은 항상 완전한 응답으로 반환됩니다.
  • 각 모델에는 최대 입력 길이가 있으며, 이를 초과하는 텍스트는 업스트림에서 잘리거나 거부됩니다.
  • 동일한 입력에 대한 임베딩은 결정론적입니다 — temperature나 무작위성이 개입하지 않습니다.

모범 사례

  • 속도/품질/비용 트레이드오프에 맞는 모델을 선택하세요 — 작은 모델(예: qwen/qwen3-embedding-4b)은 저렴하고 빠르며, 큰 모델(예: openai/text-embedding-3-large)은 일반적으로 더 높은 정확도로 임베딩합니다.
  • 텍스트별로 호출하는 대신 여러 텍스트를 한 번의 요청에 배치로 담으세요 — 왕복 횟수와 오버헤드가 줄어듭니다.
  • 결과를 캐시하세요 — 동일한 입력의 임베딩은 절대 변하지 않으므로, 다시 생성하지 말고 저장해 두세요.
  • 유클리드 거리 대신 코사인 유사도로 비교하세요 — 스케일에 불변하며 고차원 벡터에 더 적합합니다.
  • 각 모델의 컨텍스트 길이에 유의하세요 — 긴 문서는 임베딩 전에 청크로 나눠야 할 수 있습니다.

파라미터

샘플링 파라미터는 토큰 생성 과정을 조정합니다. BazaarLink은 지원되는 파라미터를 업스트림 공급자에 전달합니다; 지원되지 않는 파라미터는 조용히 무시됩니다.

샘플링 파라미터

순수 패스스루 — 로컬 기본값 없음
이 값들은 전송된 그대로 업스트림 제공자에게 전달됩니다 — BazaarLink는 기본값을 주입하거나 강제하지 않습니다. 아래 "기본값"은 필드가 생략되었을 때 제공자 자체의 동작을 설명하는 것이며, BazaarLink의 보장이 아닙니다.
temperature
number
샘플링 온도 0–2. 높을수록 무작위. 기본값: 1
top_p
number
핵 샘플링 확률 질량. 기본값: 1
top_k
integer
상위 K개로 토큰 선택 제한. 0 = 비활성화 (모두 고려). 기본값: 0
frequency_penalty
number
반복 토큰 패널티. 범위: [-2, 2]. 기본값: 0
presence_penalty
number
존재 기반 토큰 패널티. 범위: [-2, 2]. 기본값: 0
repetition_penalty
number
입력에서 토큰 반복 감소. 범위: (0, 2]. 기본값: 1
min_p
number
상위 토큰 대비 최소 확률. 범위: [0, 1]. 기본값: 0
top_a
number
최고 확률 토큰 기반 동적 top-P. 범위: [0, 1]. 기본값: 0
seed
integer
결정적 샘플링을 위한 정수 시드. 모든 모델에서 보장되지 않음
max_tokens
integer
생성할 최대 토큰 수
n
integer
생성할 완성 수. 기본값: 1
logit_bias
object
토큰 ID를 바이어스 값 [-100, 100]에 매핑하여 샘플링 전 추가. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.
logprobs
boolean
각 출력 토큰의 로그 확률 반환. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.
top_logprobs
integer
위치당 반환할 최고 확률 토큰 수 (logprobs: true 필요). 범위: 0–20. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.
response_format
object
구조화된 JSON 출력 강제. 구조화된 출력 섹션 참조
structured_outputs
boolean
지원하는 제공자에서 엄격한 JSON 스키마 준수 출력을 요청. 그대로 전달
reasoning
object
제공자별 reasoning/thinking 설정. 그대로 전달
reasoning_effort
string
OpenAI o-시리즈 스타일 reasoning 강도: "low", "medium", 또는 "high". 그대로 전달
stop
string | string[]
중지 시퀀스 — 만나면 생성 중단
tools
Tool[]
모델이 호출할 수 있는 도구(함수) 목록
tool_choice
string | object
도구 사용 제어: "auto", "none", 또는 특정 도구
parallel_tool_calls
boolean
도구 제공 시 병렬 함수 호출 활성화. 기본값: true. OpenAI 계열 모델에만 적용 — 아래 참고 사항 확인.

BazaarLink 전용 파라미터

transforms
string[]
적용할 메시지 변환, 예: ["middle-out"]. ≤8k 컨텍스트 모델에서 자동 적용하려면 생략
models
string[]
장애 복구 모델 목록 — BazaarLink이 기본 모델 실패 시 순서대로 시도
route
string
고급 라우팅 호환 필드 — 대부분의 사용자에게는 필요하지 않습니다. 폴백에는 "models"를 사용하세요.
provider
object
고급 라우팅 설정 — 대부분의 사용자에게는 필요하지 않습니다.

크레딧

현재 크레딧 잔액과 누적 API 사용량 조회.

GET/api/v1/credits
Auth
Bearer token (표준 API 키 sk-bl-...) 필요.

예제 요청

curl https://bazaarlink.ai/api/v1/credits \
  -H "Authorization: Bearer sk-bl-YOUR_KEY"

응답

{
  "data": {
    "total_credits": 100.00,
    "total_usage": 12.34
  }
}

오류: 401 (키 누락/무효), 403 (정지된 사용자).

생성 세부정보

generation ID로 단일 완료의 상세 통계 조회 (ID는 chat/completions 응답 id 또는 스트리밍 x-bz-gen-id 헤더에서).

GET/api/v1/generation?id=<generation-id>
Auth
Bearer token (표준 API 키) 필요. 필수 query 파라미터: id.

예제 요청

curl "https://bazaarlink.ai/api/v1/generation?id=gen_abc123" \
  -H "Authorization: Bearer sk-bl-YOUR_KEY"

응답

{
  "data": {
    "id": "gen_xyz...",
    "model": "openai/gpt-4.1",
    "provider": "openai",
    "created_at": "2026-04-20T10:00:00.000Z",
    "app_name": "MyApp",
    "finish_reason": "stop",
    "status": 200,
    "duration_ms": 1234,
    "first_token_ms": 234,
    "throughput": 45.6,
    "usage": {
      "prompt_tokens": 100,
      "completion_tokens": 200,
      "total_tokens": 300,
      "prompt_tokens_details": { "cached_tokens": 50 },
      "completion_tokens_details": { "reasoning_tokens": 30 },
      "cost": 0.00123
    },
    "cost_breakdown": {
      "subtotal": 0.00123,
      "cache_discount": 0.00015,
      "total": 0.00108
    }
  }
}

오류: 400 (id 누락), 401 (auth), 404 (generation 없음).

API 키 정보

현재 API 키의 rate limit 계층과 집계 사용량 카운터 조회 (응답 형식은 업계 표준 키 정보 API와 호환).

GET/api/v1/key
Auth
Bearer token (표준 API 키) 필요.

응답

{
  "data": {
    "label": "Production Key",
    "limit": null,
    "limit_remaining": 100.00,
    "limit_reset": null,
    "expires_at": null,
    "is_free_tier": false,
    "is_management_key": false,
    "is_provisioning_key": false,
    "usage": 12.34,
    "usage_daily": 0.12,
    "usage_weekly": 0.45,
    "usage_monthly": 1.23,
    "requests": 1234,
    "requests_daily": 10,
    "requests_weekly": 50,
    "requests_monthly": 200,
    "rate_limit": { "requests": 600, "interval": "1m", "note": "Paid-tier rate limit." }
  }
}
Note
크레딧 잔액이 $10 미만일 때 is_free_tier = true. 윈도우는 UTC: daily = 당일, weekly = 월~일, monthly = 1일~말일. 키에 개별 사용 한도가 설정된 경우(키 생성/수정 시 limit 파라미터), limit / limit_remaining / limit_reset은 해당 한도와 그 기간의 사용량을 반영합니다. 설정되지 않은 경우 limit은 null이며 limit_remaining은 계정 크레딧 잔액으로 대체됩니다. expires_at은 키의 만료 시각(없으면 null)입니다. is_management_key와 is_provisioning_key는 동일한 개념의 별칭으로, 관리 키인 경우 둘 다 true입니다.
BYOK
BazaarLink는 BYOK(자체 키 지참) 프로그램을 제공하지 않으므로 이 엔드포인트는 byok_usage 관련 필드를 반환하지 않습니다.

오류: 401 (auth), 404 (사용자 없음 — 드물게).

에이전트 등록

AI 에이전트(봇, 자율 시스템)를 위한 셀프서비스 등록. 트라이얼 크레딧이 포함된 API 키와 계정 업그레이드용 claim token을 반환합니다.

POST/api/v1/agents/register
Rate Limit
인증 불필요, 단 IP당 24시간에 1회 등록으로 제한.

요청 바디

name필수
string
에이전트 이름 (비어 있지 않음, trim 후 최대 100자).
description
string
선택적 에이전트 설명.
referral_code
string
선택적 추천 코드.

예제 요청

curl -X POST https://bazaarlink.ai/api/v1/agents/register \
  -H "content-type: application/json" \
  -d '{
    "name": "My Agent",
    "description": "Autonomous research bot"
  }'

응답

{
  "api_key": "sk-bl-xxxxx...",
  "credits": 0.10,
  "credits_usd": "$0.1000",
  "claim_token": "abc...xyz",
  "claim_expires": "2026-04-27T10:00:00.000Z",
  "upgrade_url": "https://bazaarlink.ai/claim?token=...",
  "referral_code": "aBcDeFgH",
  "free_model": "auto:free",
  "message": "Welcome to BazaarLink!...",
  "referral_message": "Share referral link:...",
  "base_url": "https://bazaarlink.ai/api/v1",
  "docs": "https://bazaarlink.ai/llms.txt"
}

오류: 400 (body 무효/name 누락), 429 (rate limit — 1/IP/24h), 500 (내부).

오류 코드

오류 응답 형식

모델 추론 엔드포인트는 OpenAI 호환 오류 응답을 반환합니다. type 필드는 달라지거나 생략될 수 있으므로 메시지를 파싱하지 말고 HTTP 상태와 error.code를 프로그램 로직에 사용하세요.

{
  "error": {
    "message": "Insufficient credits. Please top up to continue.",
    "type": "invalid_request_error",
    "code": "insufficient_credits"
  }
}

HTTP 상태 및 오류.코드

Before streaming, the HTTP status identifies the broad failure class. error.code is either that number or a stable string for a specific remedy. Prefer the string code when present, otherwise use the HTTP status.

코드
이름
설명
400잘못된 요청잘못된 요청, 빈 messages 배열, 또는 필수 필드 누락
401승인되지 않음API 키가 누락, 잘못됨, 또는 비활성화됨
402결제 필요계정 크레딧 부족, 키별 지출 한도 도달, 또는 월간/주간 예산 상한 초과
403금지됨계정이 정지되었거나 권한이 없음
404찾을 수 없음Requested model, generation, key, or other resource does not exist
409충돌Resource is not in the required state, such as an incomplete video job
410사라Requested model has been retired and must be replaced
413페이로드가 너무 큼요청 바디가 10 MB 초과; 콘텐츠 크기를 줄이거나 요청을 분할하세요
416범위가 만족스럽지 않음Requested byte range is invalid for generated video content
429요청이 너무 많습니다속도 제한 초과; 재시도 전 Retry-After 헤더를 확인하세요
500서버 오류BazaarLink 내부 오류
502잘못된 게이트웨이모든 업스트림 공급자 실패; 장애 복구가 시도됨
503서비스를 이용할 수 없습니다이 모델에 구성된 업스트림 공급자 없음; 관리자에게 문의하세요
504게이트웨이 시간 초과Upstream connection or stream stalled and timed out

기계 판독 가능한 청구 코드

A 402 can represent different controls. Use these stable codes to choose the correct action.

코드
설명
budget_cap_reachedA weekly or monthly budget cap was reached; raise or reset the cap.
credit_limit_exceededA monthly-billing organization's credit line was exhausted; contact billing.
insufficient_creditsThe prepaid balance is insufficient; add credits.
spend_limit_exceededThe API key reached its daily, weekly, or monthly spend limit.

Stable error.code catalog

These string codes are emitted by public inference and media paths. Branch on the string code when present; the HTTP status remains the broad failure class.

모델 및 엔드포인트
모델 조회, 수명 주기, 가격 책정, 양식 및 엔드포인트 호환성 오류입니다.
코드
HTTP 상태
unknown_model400
invalid_model_id400
model_not_found404
model_retired410
model_endpoint_mismatch400
embedding_on_chat_endpoint400
model_not_priced400
invalid_modality_for_model400
요청 및 안전
잘못된 매개변수, 컨텍스트, 도구, 스키마 및 콘텐츠 안전 거부.
코드
HTTP 상태
missing_required_field400
unsupported_param400
max_tokens_invalid400
context_too_long400
tool_use_unsupported400
malformed_tool_messages400
invalid_response_format_schema400
invalid_tools_definition400
content_moderation403
content_filter403
unknown_4xx400
이미지 생성 및 편집
이미지 입력, 멀티파트 편집, 출력 및 이미지 파이프라인 오류입니다.
코드
HTTP 상태
invalid_image_url400
input_images_not_supported400
invalid_content_type400
mask_not_supported400
unsupported_response_format400
missing_prompt400
missing_image400
too_many_images400
invalid_image_type400
image_too_large400
invalid_n400
pipeline_error502
no_images502
업스트림 라우팅
공급자 연결, 인증, 제한 및 가용성 오류를 삭제했습니다.
코드
HTTP 상태
upstream_unreachable502
upstream_auth_failed502
upstream_rate_limited429
upstream_unavailable502/503

속도 제한, 예산 및 비상 브레이크

These controls can reject an otherwise valid request and require different recovery actions.

제어
HTTP 상태
식별 방법
요청 속도 제한429숫자 코드 429; Retry-After 및 X-RateLimit-* 헤더를 사용합니다.
속도 제한 페널티 블록429숫자 코드 429 및 임시 제한 메시지; 재시도 후를 사용하십시오.
글로벌 소비 비상 브레이크503숫자 코드 503, 글로벌 지출 한도 메시지 및 30초 또는 300초 후 재시도.
Scoped spend brake429Numeric code 429 and a spend circuit-breaker message naming the scope.
청구 및 예산 관리402위에 나열된 안정적인 청구 문자열 코드를 사용하세요.

Compatibility note: rate-limit and emergency-brake paths currently emit numeric error.code values. Use HTTP status, Retry-After, and the documented response message.

비디오 및 미디어 리소스 상태

Video validation commonly returns numeric code 400. Missing jobs return 404, retired models 410, unfinished video content 409, and invalid video byte ranges 416.

재시도 정책

Retry only failures that may recover without changing the request. Honor Retry-After or use exponential backoff with jitter. Do not stack SDK and manual retries.

백오프로 재시도
429, 502, 503, and 504. Check the original generation job before creating another after an ambiguous network failure.
재시도하기 전에 수정하세요
400, 401, 402, 403, 404, 409, 410, 413, and 416. Fix the request, credentials, balance, permissions, resource state, or Range header first.

오류 처리

import random
import time
from openai import OpenAI, APIStatusError

client = OpenAI(
    base_url="https://bazaarlink.ai/api/v1",
    api_key="sk-bl-YOUR_API_KEY",
    max_retries=0,  # Avoid double retries; this example handles them.
)

RETRYABLE = {429, 502, 503, 504}

for attempt in range(5):
    try:
        response = client.chat.completions.create(
            model="openai/gpt-4.1",
            messages=[{"role": "user", "content": "Hello!"}],
        )
        break
    except APIStatusError as error:
        if error.status_code not in RETRYABLE or attempt == 4:
            raise
        retry_after = error.response.headers.get("Retry-After")
        delay = (
            float(retry_after)
            if retry_after
            else min(8, 0.5 * (2 ** attempt)) + random.uniform(0, 0.25)
        )
        time.sleep(delay)

스트리밍 오류 형식

토큰 스트리밍 전에 발생한 오류는 JSON 바디와 함께 표준 HTTP 오류 응답을 반환합니다.

After a stream starts, the HTTP response is already 200. Parse each SSE data frame and treat a top-level error or choices[0].finish_reason === "error" as a failed, incomplete response.

스트림이 중간에 실패하면 BazaarLink는 최상위 error 객체를 담은 마지막 SSE 이벤트를 보내고 이어서 data: [DONE]을 보냅니다. 일부 업스트림에서 그대로 전달되는 청크는 대신 choice에 오류를 담을 수 있습니다(choices[0].finish_reason === "error") — 두 경우 모두 처리하세요.

// If the stream fails mid-flight, BazaarLink emits a final SSE event
// with a top-level "error" object, followed by data: [DONE]
data: {"error":{"message":"Upstream stream interrupted. The response is incomplete.","type":"upstream_error","code":502}}

data: [DONE]

// Chunks relayed verbatim from some upstreams may instead carry the error
// inline on the choice: choices[0].finish_reason === "error" with an
// "error" object ({ code, message }) on the choice — handle both shapes.
// Branch on error.code; error.type can vary by failure path.

버전 관리

BazaarLink는 단일 안정 API 경로인 /api/v1을 제공합니다 — 관리해야 할 날짜 고정 버전이나 버전 헤더가 없습니다. API는 번호가 매겨진 릴리스가 아니라 지속적으로 발전합니다.

비파괴적 변경

다음은 사전 공지 없이 배포됩니다:

  • 새 엔드포인트
  • 카탈로그에 새 모델 추가
  • 새로운 선택적 요청 매개변수
  • 새로운 응답 필드
  • 선택적 속성을 가진 새 스키마
  • 추가 응답 상태/오류 코드
방어적으로 클라이언트를 작성하세요
인식하지 못하는 응답 필드는 무시하고, enum 형태 필드의 알 수 없는 값에서 실패하지 않도록 하세요 — 카탈로그와 기능이 늘어나면서 새 값이 추가됩니다.

파괴적 변경

이는 드물게 발생하며, 다음을 포함합니다:

  • 엔드포인트, 매개변수, 응답 필드를 제거하거나 이름을 바꾸는 것
  • 필드 타입을 변경하는 것
  • 선택적 매개변수를 필수로 만드는 것

발생하더라도 파괴적 변경은 전체 /api/v1 표면이 아니라 특정 엔드포인트에만 적용됩니다 — 모든 연동을 한 번에 깨뜨릴 수 있는 단일 버전 업그레이드는 없습니다. 아직 Breaking 태그가 있는 공식 changelog는 게시하지 않습니다(아래 "최신 정보 확인" 참고) — 연동에 중요한 부분이라면, 문서화되지 않은 동작에 의존하기 전에 Support에 문의하세요.

지원 종료 정책

예상해야 할 유일한 정기적인 "파괴적" 이벤트: 업스트림 공급자가 지원을 종료함에 따라 개별 모델이 폐지됩니다. GET /api/v1/models로 모델의 현재 상태를 조회하세요.

GET https://bazaarlink.ai/api/v1/models
Authorization: Bearer sk-bl-YOUR_API_KEY

# A model within 30 days of its deprecation date shows in the catalog
# with an "EOL" badge on the Models page. After the effective date it's
# dropped from the catalog and calls return:
# 410 { "error": { "type": "model_not_available", "code": "model_retired" } }

최신 정보 확인

아직 전용 API changelog나 RSS 피드는 게시하지 않습니다. 지금은 이 페이지를 직접 확인하거나, GET /api/v1/models로 모델 상태를 확인하거나, 중요한 연동에 사전 통지가 필요하면 Support에 문의하세요.

Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
API 레퍼런스 | 채팅, 임베딩 및 모델 라우팅