Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Environment:Marker Inc Korea AutoRAG API Keys Configuration

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Credentials, RAG
Last Updated 2026-02-12 00:00 GMT

Overview

Configuration of API keys and credentials required by AutoRAG's external service integrations including LLM providers, reranker APIs, and document parsing services.

Description

AutoRAG integrates with multiple external APIs that require authentication via environment variables. These include OpenAI for LLM generation and embeddings, Cohere for reranking, VoyageAI for reranking, Jina AI for reranking, Mixedbread AI for reranking, Naver Clova for OCR document parsing, Anthropic for multimodal parsing, and Google Gemini for multimodal parsing. API keys can be provided either as environment variables or as parameters in the YAML configuration using `${ENV_VAR}` substitution syntax.

Usage

Set the relevant environment variables before running any AutoRAG pipeline that uses external API services. Only the keys for the specific services you use are required. For example, if you only use OpenAI for generation and Cohere for reranking, only `OPENAI_API_KEY` and `COHERE_API_KEY` need to be set.

System Requirements

Category Requirement Notes
Network Internet access Required for all API-based modules
Authentication Valid API keys Each provider requires separate registration

Credentials

The following environment variables are recognized by AutoRAG:

LLM and Embedding Providers

  • `OPENAI_API_KEY`: OpenAI API key for GPT models and embeddings. Used by OpenAI generator, LlamaIndex OpenAI LLM, and multimodal LlamaParse.

Reranker API Keys

  • `COHERE_API_KEY`: Cohere API key for reranking. Falls back to `CO_API_KEY` if not set.
  • `CO_API_KEY`: Alternative Cohere API key name (fallback).
  • `VOYAGE_API_KEY`: VoyageAI API key for reranking.
  • `JINAAI_API_KEY`: Jina AI API key for reranking.
  • `MXBAI_API_KEY`: Mixedbread AI API key for reranking.

Document Parsing Services

  • `CLOVA_URL`: Naver Clova OCR service endpoint URL.
  • `CLOVA_API_KEY`: Naver Clova OCR API key.
  • `ANTHROPIC_API_KEY`: Anthropic API key for multimodal LlamaParse (Claude models).
  • `GEMINI_API_KEY`: Google Gemini API key for multimodal LlamaParse.

Internal Environment Variables

  • `PROJECT_DIR`: Set internally by AutoRAG during trial execution. Not user-configurable.

Quick Install

# Set environment variables (add to .env or shell profile)
export OPENAI_API_KEY="your-openai-key"
export COHERE_API_KEY="your-cohere-key"
export VOYAGE_API_KEY="your-voyage-key"

# Or use ${VAR} syntax in YAML config files
# AutoRAG substitutes environment variables automatically

Code Evidence

Cohere API key lookup with fallback from `autorag/nodes/passagereranker/cohere.py:26-28`:

api_key = os.getenv("COHERE_API_KEY", None) if api_key is None else api_key
if api_key is None:
    api_key = os.getenv("CO_API_KEY", None)

OpenAI API key for multimodal parsing from `autorag/data/parse/llamaparse.py:86`:

os.getenv("OPENAI_API_KEY", None) if _api_key is None else _api_key

YAML environment variable substitution from `autorag/utils/util.py:275`:

val = val.replace(f"${{{match}}}", os.environ.get(match, ""))

Clova OCR credential loading from `autorag/data/parse/clova.py:36-43`:

url = os.getenv("CLOVA_URL", None) if url is None else url
# ...
api_key = os.getenv("CLOVA_API_KEY", None) if api_key is None else api_key

Common Errors

Error Message Cause Solution
`AuthenticationError` from OpenAI Invalid or missing OPENAI_API_KEY Set `export OPENAI_API_KEY="sk-..."` in your environment
`Cohere API error` Missing COHERE_API_KEY Set either `COHERE_API_KEY` or `CO_API_KEY`
Empty substitution in YAML Environment variable not set Ensure `${VAR_NAME}` variables are exported before running

Compatibility Notes

  • Parameter override: All API key environment variables can be overridden by passing the key directly as a function parameter or in the YAML config.
  • YAML substitution: Use `${ENV_VAR}` syntax in YAML configuration files. The `convert_env_in_dict()` function replaces these at config load time.
  • Cohere dual-name: Cohere supports both `COHERE_API_KEY` and `CO_API_KEY` for backwards compatibility.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment