xAI launches Collections API to search files with AI
xAI launches Collections API for uploading and searching information in PDFs, spreadsheets, and codebases. The service offers one free week of storage and indexing, then charges $2.50 per 1,000 searches.

xAI has launched Collections API, a tool that lets developers upload documents and codebases, turn them into a knowledge base, and let an AI find specific information inside them.
The API accepts everything from PDF files and Excel spreadsheets to complete code repositories. Its goal is to simplify the creation of RAG applications, systems that search for relevant information in documents before generating a response. This allows the model to answer using specific excerpts instead of relying only on what it learned during training.
What it lets you do
With Collections, a company could upload contracts, financial reports, or technical documentation and then ask questions about that material. For example, a system could locate a figure in a spreadsheet, find a clause spread across several contracts, or explain how part of a large codebase works.
The difference is that xAI handles the hardest parts of this process: storing, indexing, and retrieving the files. Indexing means organizing the content so it can be found quickly when someone makes a query.
The API offers two ways to retrieve information, although the announcement does not explain the differences between them in the provided text. It also includes hybrid search, which combines the meaning of words with exact matches. This is particularly useful for numbers, tables, technical names, and legal references.
Pricing and data use
During the first week, xAI offers free file storage and indexing. After that, retrieval costs $2.50 per 1,000 searches, according to the announcement.
xAI also says that data stored in Collections is not used to train its models, unless the user has given consent. For a company working with financial documents, contracts, or private code, this condition matters just as much as search speed.
Results on complex documents
The company compared Collections API with Grok 4.1 Fast, Google Gemini Pro 3, and OpenAI GPT 5.1 on finance, legal, and programming tasks. The results published by xAI were as follows:
- Finance: Grok 4.1 Fast scored 93.0%, compared with 85.9% for Gemini Pro 3 and 84.7% for GPT 5.1.
- Legal: Grok scored 73.9%, below Gemini Pro 3 at 74.5% and above GPT 5.1 at 71.2%.
- Code: Grok scored 86%, compared with 85% for Gemini Pro 3 and 81% for GPT 5.1.
The tests are based on specialized datasets. LegalBench evaluates questions about contracts and complex legal references, while DeepCodeBench measures understanding of code from real repositories. Finance testing covered numerical and tabular questions, a type of query where search based only on meaning can confuse figures or rows.
These are the results reported by xAI and do not amount to a guarantee for every file or application. Performance will depend on document quality, the questions asked, and how the API is integrated.
For you, the practical change is straightforward: creating an assistant that knows your own documents should require less infrastructure. The important thing will be checking the cost as search volume grows and verifying that responses cite the correct excerpts, especially in areas where a misinterpreted number or clause can have real consequences.