ExBifrost.Api.CursorIntegration (ex_bifrost v0.1.0)

Copy Markdown View Source

API calls for all endpoints tagged CursorIntegration.

Summary

Functions

Anthropic complete (Cursor mount) Cursor mount of the legacy Anthropic POST /v1/complete endpoint.

Anthropic count tokens (Cursor mount) Cursor mount of POST /anthropic/v1/messages/count_tokens.

Anthropic messages (Cursor mount) Cursor mount of POST /anthropic/v1/messages. Same request/response shape and streaming behaviour.

Anthropic messages — wildcard (Cursor mount) Cursor mount of the Anthropic messages wildcard (POST /anthropic/v1/messages/{path}). Routes extended Anthropic messages endpoints (e.g. batches, count tokens) through Cursor.

Bedrock invoke-with-response-stream (Cursor mount)

Cursor hybrid chat completions Accepts Cursor's hybrid chat-completions payload (which is structurally a Responses API request with input blocks) and returns a chat- completions-shaped response (choices + delta chunks for streams). Routes the request through the Responses pipeline internally.

Gemini list models (Cursor mount) Cursor mount of GET /genai/v1beta/models.

Gemini model action (Cursor mount) Cursor mount of Gemini's wildcard generate-content/embed/count-tokens/ predict endpoints. The model path parameter includes the action suffix (e.g. gemini-pro:generateContent).

List models (Cursor) Lists available models, returning the OpenAI /v1/models shape.

Vertex rank (Cursor mount) Cursor mount of POST /genai/v1/rank — Vertex AI ranking.

Functions

cursor_anthropic_complete(connection, anthropic_text_request, opts \\ [])

Anthropic complete (Cursor mount) Cursor mount of the legacy Anthropic POST /v1/complete endpoint.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • anthropic_text_request (AnthropicTextRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.AnthropicCreateComplete200Response.t} on success
  • {:error, Tesla.Env.t} on failure

cursor_anthropic_count_tokens(connection, anthropic_message_request, opts \\ [])

@spec cursor_anthropic_count_tokens(
  Tesla.Env.client(),
  ExBifrost.Model.AnthropicMessageRequest.t(),
  keyword()
) :: {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Anthropic count tokens (Cursor mount) Cursor mount of POST /anthropic/v1/messages/count_tokens.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • anthropic_message_request (AnthropicMessageRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_anthropic_messages(connection, anthropic_message_request, opts \\ [])

Anthropic messages (Cursor mount) Cursor mount of POST /anthropic/v1/messages. Same request/response shape and streaming behaviour.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • anthropic_message_request (AnthropicMessageRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.AnthropicMessageResponse.t} on success
  • {:error, Tesla.Env.t} on failure

cursor_anthropic_messages_wildcard(connection, path, anthropic_message_request, opts \\ [])

Anthropic messages — wildcard (Cursor mount) Cursor mount of the Anthropic messages wildcard (POST /anthropic/v1/messages/{path}). Routes extended Anthropic messages endpoints (e.g. batches, count tokens) through Cursor.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • path (String.t):
  • anthropic_message_request (AnthropicMessageRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.AnthropicMessageResponse.t} on success
  • {:error, Tesla.Env.t} on failure

cursor_bedrock_converse(connection, model_id, bedrock_converse_request, opts \\ [])

Bedrock converse (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • model_id (String.t):
  • bedrock_converse_request (BedrockConverseRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.BedrockConverseResponse.t} on success
  • {:error, Tesla.Env.t} on failure

cursor_bedrock_converse_stream(connection, model_id, bedrock_converse_request, opts \\ [])

@spec cursor_bedrock_converse_stream(
  Tesla.Env.client(),
  String.t(),
  ExBifrost.Model.BedrockConverseRequest.t(),
  keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}

Bedrock converse stream (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • model_id (String.t):
  • bedrock_converse_request (BedrockConverseRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, String.t} on success
  • {:error, Tesla.Env.t} on failure

cursor_bedrock_count_tokens(connection, model_id, cursor_bedrock_count_tokens_request, opts \\ [])

Bedrock count tokens (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • model_id (String.t):
  • cursor_bedrock_count_tokens_request (CursorBedrockCountTokensRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.BedrockCountTokens200Response.t} on success
  • {:error, Tesla.Env.t} on failure

cursor_bedrock_invoke(connection, model_id, request_body, opts \\ [])

@spec cursor_bedrock_invoke(
  Tesla.Env.client(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Bedrock invoke (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • model_id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_bedrock_invoke_stream(connection, model_id, request_body, opts \\ [])

@spec cursor_bedrock_invoke_stream(
  Tesla.Env.client(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}

Bedrock invoke-with-response-stream (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • model_id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, String.t} on success
  • {:error, Tesla.Env.t} on failure

cursor_bedrock_rerank(connection, request_body, opts \\ [])

@spec cursor_bedrock_rerank(
  Tesla.Env.client(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Bedrock rerank (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_chat_completions(connection, open_ai_responses_request, opts \\ [])

Cursor hybrid chat completions Accepts Cursor's hybrid chat-completions payload (which is structurally a Responses API request with input blocks) and returns a chat- completions-shaped response (choices + delta chunks for streams). Routes the request through the Responses pipeline internally.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • open_ai_responses_request (OpenAiResponsesRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ChatCompletionResponse.t} on success
  • {:error, Tesla.Env.t} on failure

cursor_cohere_chat(connection, request_body, opts \\ [])

@spec cursor_cohere_chat(
  Tesla.Env.client(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Cohere chat (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_cohere_embed(connection, request_body, opts \\ [])

@spec cursor_cohere_embed(
  Tesla.Env.client(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Cohere embed (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_cohere_rerank(connection, request_body, opts \\ [])

@spec cursor_cohere_rerank(
  Tesla.Env.client(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Cohere rerank (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_cohere_tokenize(connection, request_body, opts \\ [])

@spec cursor_cohere_tokenize(
  Tesla.Env.client(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Cohere tokenize (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_gemini_list_models(connection, opts \\ [])

@spec cursor_gemini_list_models(
  Tesla.Env.client(),
  keyword()
) :: {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Gemini list models (Cursor mount) Cursor mount of GET /genai/v1beta/models.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_gemini_model_action(connection, model, gemini_generation_request, opts \\ [])

Gemini model action (Cursor mount) Cursor mount of Gemini's wildcard generate-content/embed/count-tokens/ predict endpoints. The model path parameter includes the action suffix (e.g. gemini-pro:generateContent).

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • model (String.t): Model name optionally followed by an action suffix.
  • gemini_generation_request (GeminiGenerationRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.GeminiGenerationResponse.t} on success
  • {:error, Tesla.Env.t} on failure

cursor_gemini_retrieve_video_operation(connection, model, operation_id, opts \\ [])

@spec cursor_gemini_retrieve_video_operation(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Gemini video operation polling (Cursor mount)

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • model (String.t):
  • operation_id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_list_models(connection, opts \\ [])

@spec cursor_list_models(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

List models (Cursor) Lists available models, returning the OpenAI /v1/models shape.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

cursor_vertex_rank(connection, request_body, opts \\ [])

@spec cursor_vertex_rank(
  Tesla.Env.client(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}} | {:error, Tesla.Env.t()}

Vertex rank (Cursor mount) Cursor mount of POST /genai/v1/rank — Vertex AI ranking.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure