pub async fn send_completion_request(
client: &Client,
api_key: &str,
request: &CompletionRequest,
) -> Result<CompletionResponse, OpenRouterError>
Expand description
Send a completion request to a selected model (text-only format)
§Arguments
client
- The HTTP client to use for the request.api_key
- The API key for authentication.request
- The completion request containing the model, prompt, and other optional parameters.
§Returns
Result<CompletionResponse, OpenRouterError>
- The response from the completion request, containing the generated text and other details.