EnglishSetup GuidesOpenAI API Key

Get an OpenAI API Key

For: Danum tenants. Used for RAG embeddings (knowledge base search) plus LLM fallback. Time: 5 minutes.

Why OpenAI (not just Claude)?

Danum uses text-embedding-3-small from OpenAI for RAG (retrieval-augmented generation): finding relevant chunks from your knowledge base before answering with Claude. Anthropic’s embedding model is not yet production-ready for multi-lingual (Indonesian) text, so we still use OpenAI for embeddings.

Steps

1. Create an OpenAI account

2. Set up billing

3. Generate the API key

  • Go to https://platform.openai.com/api-keys
  • Click Create new secret key.
  • Name it (for example danum-ai-production).
  • Copy the key (format sk-*, about 50 characters). Save it in a password manager if needed.

4. Enter it in the Danum dashboard

Cost estimate

text-embedding-3-small: $0.02 per 1M tokens (about Rp 310). For a knowledge base of 1000 documents (roughly 3000 words each = 4M tokens), full re-embed costs about Rp 1,240 one-time. Per-query embeddings (per user question) cost about Rp 0.01 each.

Fallback LLM model gpt-4o-mini: $0.15 / $0.60 per 1M input/output tokens - much cheaper than Claude Sonnet.

Troubleshooting

Q: You exceeded your current quota error. Top up credit at the OpenAI billing dashboard.

Q: RAG retrieval is not accurate. Check that documents are ingested (Knowledge > Documents > status = READY). Re-index if you just uploaded many documents.

Q: Required or optional?

  • Required if you use the Knowledge Base and RAG features.
  • Optional if your AI agent is plain conversation without document retrieval.