Generate code completions
POST
/api/v4/code_suggestions/completions
Generates code completions. Uses the AI abstraction layer to generate code completions. Requests to this endpoint are proxied to the AI Gateway.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
current_file
required
Object that contains information about the current file
object
file_name
required
The name of the current file
string
content_above_cursor
required
The content above cursor
string
content_below_cursor
The content below cursor
string
intent
The intent of the completion request, current options are “completion” or “generation”
string
generation_type
The type of generation request
string
stream
The option to stream code completion response
boolean
project_path
The path of the project
string
Example
namespace/projectuser_instruction
Additional instructions provided by a user
string
context
List of related context parts
Array<object>
object
type
required
The type of a related part of context
string
name
required
The name of a related part of context
string
content
required
The content of a part of context
string
Responses
Section titled “Responses”OK
Bad Request