Skip to contents

This function processes annotation requests using the OpenRouter API, which provides access to various LLM models including OpenAI, Anthropic, Meta, and Google models. OpenRouter also offers free models with the :free suffix (e.g., 'meta-llama/llama-4-maverick:free').

Usage

process_openrouter(prompt, model, api_key)

Arguments

prompt

Character string containing the prompt to send to the API

model

Character string specifying the model to use (e.g., 'openai/gpt-4o' or 'meta-llama/llama-4-maverick:free')

api_key

Character string containing the OpenRouter API key

Value

Character vector containing the model's response

Details

For free models, use the :free suffix in the model name. For example:

  • 'meta-llama/llama-4-maverick:free' - Meta Llama 4 Maverick (free)

  • 'nvidia/llama-3.1-nemotron-ultra-253b-v1:free' - NVIDIA Nemotron Ultra 253B (free)

  • 'deepseek/deepseek-chat-v3-0324:free' - DeepSeek Chat v3 (free)

  • 'microsoft/mai-ds-r1:free' - Microsoft MAI-DS-R1 (free)

Free models don't consume credits but may have limitations compared to paid models.