Skip to content
KoboldCpp
GitHub

API endpoints reference

Every endpoint KoboldCpp serves, grouped by API family. For request fields, see the API docs at /api on your instance or lite.koboldai.net/koboldcpp_api.

How to read the tables:

  • Password: Yes means the endpoint needs the password when one is set (--password). No means it never checks. Admin means admin mode and the admin password. See Passwords and security.
  • Needs: the model or flag that must be loaded for the endpoint to do its job. "Text model" is the model in GGUF Text Model:.
  • A path in brackets is an alias that does the same.
  • A short path after a comma continues the first path's prefix: /api/extra/multiplayer/status, /getstory means /api/extra/multiplayer/getstory.
PathMethodPasswordPurposeNeeds
/api/v1/generate (/api/latest/generate)POSTYesGenerate textText model
/api/extra/generate/streamPOSTYesGenerate text, streamed as server-sent eventsText model
/api/extra/generate/checkGET, POSTYesText generated so far by the running request; POST with genkey for your own requestText model
/api/extra/abortPOSTYesStop generating; with genkey only your own requestText model
/api/extra/last_logprobsGET, POSTYesToken probabilities of the last generationText model
/api/extra/tokencount (/api/extra/tokenize)POSTYesCount and list tokens; also accepts OpenAI-style messagesText model
/api/extra/detokenizePOSTYesTurn token IDs back into textText model
/api/extra/json_to_grammarPOSTYesConvert a JSON schema to a grammar
/api/v1/modelGETPartlyLoaded model name; without a valid key it returns koboldcpp/protected-model
/api/v1/config/max_length, /api/v1/config/max_context_lengthGETNoLimits reported to KoboldAI clients: max_length is 1024 unless --hordegenlen is set (not Default Gen Amt:); max_context_length is the context size, or --hordemaxctx if set
/api/v1/config/soft_prompt, /api/v1/config/soft_prompts_listGETNoCompatibility stubs for KoboldAI clients
/api/v1/info/versionGETNoKoboldAI API version (1.2.5)
/api/extra/versionGETNoKoboldCpp version and active features
/api/extra/true_max_context_lengthGETNoContext size the server allocated
/api/extra/perfGETNoSpeed of the last request, queue length
/api/extra/preloadstoryGETNoStory set with --preloadstory--preloadstory
/api/extra/websearchPOSTYesWeb search, body {"q": "..."}; returns [] when off--websearch
/api/extra/multiplayer/status, /getstory, /setstoryPOSTYesShared multiplayer session--multiplayer
/api/extra/data/list, /load, /savePOSTYesServer-side save slots--savedatafile
/api/extra/transcribePOSTYesSpeech-to-textWhisper model or audio mmproj
/api/extra/ttsPOSTYesText-to-speechTTS model
/api/extra/speakers_listGETNoTTS voices
/api/extra/embeddingsPOSTYesEmbeddingsEmbeddings model
/api/extra/music/preparePOSTYesPlan a song (audio codes)Music models
/api/extra/music/generatePOSTYesGenerate music as WAV or MP3Music models
/requestPOSTYesLegacy format: {text, max} in, {"data": {"seqs": [...]}} outText model
/api, /docsGETNoAPI documentation

Without --savedatafile, /api/extra/data/list and /load close the connection without an answer, and /save returns HTTP 400.

PathMethodPasswordPurposeNeeds
/v1/completions (/v1/completion, /completions)POSTYesText completionText model
/v1/chat/completions (/chat/completions)POSTYesChat, with tools and images; thinking text in reasoning_contentText model; vision mmproj for images
/v1/responses (/responses)POSTYesOpenAI Responses APIText model
/v1/models (/models)GETNoLoaded model; in router mode also the admin-directory configs
/v1/embeddingsPOSTYesEmbeddings; supports encoding_format: base64Embeddings model
/v1/audio/transcriptions (/audio/transcriptions)POSTYesSpeech-to-text; JSON with audio_data, or a multipart file uploadWhisper model or audio mmproj
/v1/audio/speech (/audio/speech)POSTYesText-to-speech; response_format: mp3 for MP3TTS model
/v1/audio/voices (/audio/voices)GETNoTTS voices
/v1/images/generations (/images/generations)POSTNoGenerate an imageImage model
/v1/images/edits (/images/edits)POSTNoEdit an imageImage model
/v1GETNoLanding page
PathMethodPasswordPurposeNeeds
/v1/messages (/messages)POSTYes, Bearer onlyAnthropic Messages API, with images and tool callsText model

Run KoboldCpp with --port 11434 so Ollama apps find it.

PathMethodPasswordPurposeNeeds
/api/generatePOSTYesText completion; streams unless "stream": falseText model
/api/chatPOSTYesChat with tool calls; streams unless "stream": falseText model
/api/embedPOSTYesEmbeddingsEmbeddings model
/api/tags, /api/psGETNoModel list
/api/versionGETNoReports Ollama version 0.7.0
/api/showPOSTNoFixed placeholder model info
PathMethodPasswordPurposeNeeds
/sdapi/v1/txt2imgPOSTNoText to image; also video with framesImage model
/sdapi/v1/img2imgPOSTNoImage to image, inpaintingImage model
/sdapi/v1/upscale, /sdapi/v1/extra-single-imagePOSTNoUpscale an imageUpscaler (--sdupscaler)
/sdapi/v1/interrogatePOSTNoDescribe an imageVision mmproj; returns 503 No Vision model loaded without
/sdapi/v1/sd-models, /options, /samplers, /schedulers, /loras, /upscalers, /latent-upscale-modesGETNoLists and settingsImage model
/sdapi/v1/progress, /sdapi/v1/get_last.jsonGETNo (scoped by genkey)Progress and last resultImage model
PathMethodPasswordPurposeNeeds
/promptPOSTNoGenerate an image; answers when it is done, with a fixed job IDImage model
/upload/image (/api/upload/image)POSTNoUpload an input imageImage model
/view (/view.png, /api/view, /view_image)GETNoGet the generated imageImage model
/history (/api/history)GETNoEmulated history that only holds the last imageImage model
/ping, /system_stats, /object_infoGETNoCompatibility answers; /system_stats holds placeholder values
/models/checkpoints, /models/loras (also under /api/)GETNoModel lists
/wsGETNoWebSocket handshake only
PathMethodPasswordPurposeNeeds
/tts_to_audioPOSTNoText-to-speechTTS model
/speakers_list, /speakersGETNoVoices
/get_tts_settingsGETNoSettings stub
/set_tts_settingsPOSTNoAccepts anything, changes nothing
/voice/check, /voice/speakers, /voice/vitsGETNoLegacy TTS endpoints

Only active with admin mode (Enable Model Administration, --admin). See Admin mode.

PathMethodPasswordPurpose
/api/admin/list_optionsGETAdminConfigs and models you can switch to
/api/admin/reload_configPOSTAdminSwitch config or model, body {"filename": "..."}; unload_model and initial_model are special names
/api/admin/check_state, /save_state, /load_state, /clear_statePOSTAdminSave and restore the KV cache
PathMethodPasswordPurposeNeeds
/mcpPOSTYesMCP JSON-RPC proxy (initialize, tools/list, tools/call)--mcpfile
/propsGETNollama.cpp-style info: chat template, n_ctx, vision and audio support
/slotsGETNoAlways 501; not supported
/.well-known/serviceinfoGETNoService info
/GETNoKoboldAI Lite
/noscriptGETNoInterface without JavaScript
/lcpp/GETNollama.cpp WebUI
/sduiGETNoStable UI for imagesImage model to generate
/musicuiGETNoMusic and TTS interfaceMusic or TTS model to generate
/manifest.jsonGETNoWeb app manifest

The API docs at /api leave out: the Ollama, ComfyUI and XTTS endpoints, /v1/images/edits, /v1/audio/voices, /mcp, /request, /sdapi/v1/extra-single-image, the A1111 GET lists other than sd-models, options and samplers, the soft prompt stubs and /slots.