Skip to content
Trang này chưa có bản dịch sang ngôn ngữ của bạn, nên hiện đang được hiển thị bằng tiếng Anh.
Moonshot AI · Kimi

kimi-k2.7-code API

Use kimi-k2.7-code on APISea for text-based coding workflows through an OpenAI-compatible chat API.

ChatChat & Văn bảnĐồng bộLưu prompt vào bộ nhớ đệm
ID model
kimi-k2.7-code

Bảng giá API kimi-k2.7-code

Tất cả giá đều tính bằng USD. So sánh mức giá của APISea với giá niêm yết chính thức cho cùng đơn vị.

Loại tokenAPISeaChính thứcTiết kiệm
Đầu vào mỗi 1M token$0.836$0.95−12%
Đầu vào đã lưu trong bộ nhớ đệm mỗi 1M token$0.1672$0.19−12%
Đầu ra mỗi 1M token$3.52$4.00−12%

kimi-k2.7-code là gì?

kimi-k2.7-code is a Moonshot AI model in the Kimi family, available through APISea's chat API. Its code suffix positions it for coding-focused text workflows, such as drafting implementations, explaining source code, and discussing changes. Requests use a messages array with system, user, and assistant roles, and responses contain generated text. The listed limits are 262,144 input tokens and 262,144 output tokens. The chat interface offers streaming or complete responses, plus controls including temperature, top_p, max_tokens, and stop sequences.

Call the model through APISea's OpenAI-compatible base URL, https://api.apisea.ai/v1, using your API key and the exact model ID kimi-k2.7-code. Billing is pay-as-you-go and applies only to successful requests: input costs $0.836 per 1M tokens, cached input reads cost $0.1672 per 1M tokens, and output costs $3.52 per 1M tokens. The default configuration is about 12% below the provider list price.

Điểm nổi bật của kimi-k2.7-code

Large Token Limits

The model lists a maximum input of 262,144 tokens and a maximum output of 262,144 tokens.

Prompt Cache Reads

Prompt-cache reads are supported. Cached input costs $0.1672 per 1M tokens on APISea.

Flexible Response Delivery

Use streaming for SSE responses or disable streaming to receive the complete response at once.

Generation Controls

Control output length with max_tokens and randomness with temperature or top_p. The chat interface also accepts up to four stop sequences.

Cách gọi API kimi-k2.7-code trong 4 bước

  1. 01

    Tạo API key

    Đăng nhập APISea, nạp tối thiểu $50 rồi tạo key sk-sea trong bảng điều khiển.

  2. 02

    Đặt base URL

    Dùng https://api.apisea.ai/v1 làm base URL trong SDK hoặc HTTP client.

  3. 03

    Gửi request

    Gọi POST /v1/chat/completions với "model": "kimi-k2.7-code" và các tham số bên dưới.

  4. 04

    Xử lý phản hồi

    Đọc phản hồi (hoặc truyền token theo luồng bằng stream: true). Mức sử dụng và chi phí sẽ hiển thị trong bảng điều khiển.

curl https://api.apisea.ai/v1/chat/completions \
  -H "Authorization: Bearer $APISEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k2.7-code",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Explain what an AI API gateway does in two sentences."}
    ],
    "stream": false
  }'

Tham số

Tham sốLoạiBắt buộcMặc địnhMô tả
modelstringBắt buộcgpt-5Model name
messagesarrayBắt buộc—List of conversation messages
rolestringBắt buộcuserRole type
contentstringBắt buộc—Message content
temperaturenumberTùy chọn—Controls output randomness, range 0-2
max_tokensintegerTùy chọn—Maximum number of tokens to generate
streambooleanTùy chọn—Whether to use streaming output
top_pnumberTùy chọn—Nucleus sampling parameter, range 0-1
frequency_penaltynumberTùy chọn—Frequency penalty, range -2.0 to 2.0
presence_penaltynumberTùy chọn—Presence penalty, range -2.0 to 2.0
stopstring or arrayTùy chọn—Stop sequences
nintegerTùy chọn—Number of completions to generate

Bạn có thể xây dựng gì với kimi-k2.7-code

Implementation Drafts

As a coding-positioned model, it is suited to testing workflows that turn written requirements into draft code for developer review.

Source Code Explanations

Provide source code as message text and request explanations of its structure, behavior, or assumptions.

Change Review Assistance

Supply proposed changes and relevant context, then ask for a text-based review of potential issues and follow-up questions.

Developer Chat Assistants

Build multi-turn assistants that retain previous user and assistant messages to discuss implementation choices.

Mẹo để có kết quả tốt hơn

  • 01

    Set an Output Budget

    Use max_tokens to cap generated output for each task rather than requesting the full listed output allowance.

  • 02

    Tune One Sampling Control

    For more deterministic drafts, try a lower temperature such as 0.2. The documentation recommends adjusting either temperature or top_p rather than both.

  • 03

    Account for Cache Reads

    When prompt-cache reads apply, account for them at $0.1672 per 1M tokens. Check the model documentation for cache behavior before assuming repeated text will be cached.

  • 04

    Choose Streaming Explicitly

    Set stream to true for SSE output or false for a complete response. Explicitly setting it avoids relying on the endpoint's default.

Giới hạn và những điều cần biết

  • Maximum input is 262,144 tokens; maximum output is 262,144 tokens.

  • The supplied documentation describes text messages and text responses, not model-specific image, audio, or video support.

  • The code suffix indicates positioning, not a verified coding benchmark or correctness guarantee.

Câu hỏi thường gặp về API kimi-k2.7-code

How much does kimi-k2.7-code cost on APISea?

Input costs $0.836 per 1M tokens, cached input reads cost $0.1672 per 1M tokens, and output costs $3.52 per 1M tokens. The default configuration is about 12% below the provider list price, with pay-as-you-go billing only for successful requests.

How do I call kimi-k2.7-code?

Send a POST request to https://api.apisea.ai/v1/chat/completions with Bearer Token authentication using your APISea key. Set the model field to kimi-k2.7-code and include a messages array containing role and content fields.

Which generation parameters can I use?

The documented chat interface includes temperature, top_p, max_tokens, stream, frequency_penalty, presence_penalty, stop, and n. Temperature ranges from 0–2, and top_p ranges from 0–1.

What are the token limits?

The listed maximum input is 262,144 tokens, and the listed maximum output is 262,144 tokens. Use max_tokens to set the requested output cap.

Can I use kimi-k2.7-code commercially?

Commercial use is subject to the provider's terms. Review Moonshot AI's applicable terms and APISea's terms before deploying your application.

How does kimi-k2.7-code compare with other Kimi models?

The code suffix positions kimi-k2.7-code for coding-focused work. The supplied facts do not establish performance differences from other Kimi models, so compare candidates using your own tasks.

Model liên quan

Hệ sinh thái gồm 250+ mô hình · Nạp tối thiểu $50

Bắt đầu xây dựng với kimi-k2.7-code

Chỉ cần một key, thanh toán theo mức sử dụng từ $50; chỉ tính phí cho các request thành công.