xAI has introduced new API endpoints for creating embeddings and managing collections. The Embeddings API allows users to generate vector representations of input text and to list available embedding models. Concurrently, the Collections API provides functionalities for managing collections and documents, accessible via the Management API.
Key Points
- The Embeddings API includes endpoints for creating embedding vector representations from input text.
- Users can list all embedding models available to their authenticated API key, including details like modalities, fingerprint, and aliases.
- The Collections API manages collections and documents, with its base URL shared with the Management API at
https://management-api.x.ai/. - Authentication for the Collections API requires an xAI Management API Key using a
Bearertoken in theAuthorizationheader. - Collection management features include defining field definitions for documents, filtering collections by
collection_id,collection_name,created_at, anddocuments_count. - Document management within collections supports filtering by metadata such as
name,content_type,size_bytes,created_at, and document-level fields. - Pricing information is available for prompt image tokens and prompt text tokens, measured in USD cents per million tokens.
Context
According to xAI documentation, the Embeddings API provides a method for converting text into vector representations, which are useful for tasks like search and recommendation. The Collections API, as detailed by xAI, enables structured organization and retrieval of documents, with capabilities for defining document fields and applying filters for precise data management.
Why It Matters
These new APIs offer developers tools to integrate advanced text processing and data organization capabilities into their applications. The ability to create embeddings and manage structured collections can enhance the functionality and efficiency of AI-powered systems.
What To Do
- Review the xAI Embeddings API documentation for details on creating embedding vectors.
- Explore the xAI Collections API documentation to understand how to manage collections and documents.
- Note the authentication requirements for the Collections API, specifically the use of an xAI Management API Key.
- Compare the pricing for prompt image and text tokens to estimate costs for embedding usage.
