Kimi K2.7 Code from Moonshot AI is now available on AI Gateway .
K2.7 Code is a coding model built for long-horizon programming tasks, generalizing across scenarios including frontend development, DevOps, and performance optimization. The model has a native multimodal architecture that supports text and vision input, and always runs in thinking mode.
To use K2.7 Code, set model to moonshotai/kimi-k2.7-code in the AI SDK :
import { streamText } from 'ai' ;
const result = streamText ( {
model : 'moonshotai/kimi-k2.7-code' ,
prompt : 'Refactor this service to remove the N+1 queries.' ,
} ) ;
Pass an image alongside a prompt to use the model's multimodal input:
import { streamText } from 'ai' ;
const result = streamText ( {
model : 'moonshotai/kimi-k2.7-code' ,
messages : [
{
role : 'user' ,
content : [
{ type : 'text' , text : 'Describe the image in detail.' } ,
{
type : 'image' ,
image :
'https://exampleimage.com' ,
} ,
] ,
} ,
] ,
} ) ;
AI Gateway provides a unified API for calling…