MariTalk API

repository·main·Indexed 43 days ago

https://github.com/maritaca-ai/maritalk-api

An API providing access to the Sabiá family of Large Language Models, optimized for Portuguese and Brazilian contexts. It serves as a drop-in replacement for the OpenAI API, supporting the OpenAI Python SDK, streaming responses, chat mode with conversation history, and a Batch API for high-volume asynchronous operations via /api/files and /api/batches endpoints.

Tokens
48.1K
Snippets
136
Records
173
Agent score
55%

What's inside MariTalk

  1. Introduction to Sabiá models

    main

    Sabiá is a family of Portuguese-specialized models developed by Maritaca AI, available via API. These models are designed to simulate high-fidelity human interactions in Portuguese, covering tasks such as question answering, context-aware information retrieval, translation, creative text generation, and data analysis.

    Key Characteristics:

    • Language Specialization: Optimized specifically for Portuguese.
    • Billing Model: Usage is billed based on token volume (both input and output tokens).
    • Capabilities: Includes text generation, translation, tutoring, customer support, and data interpretation.

    Note: Sabiá models operate based on learned language patterns and do not possess consciousness or real understanding.

  2. Overview of the MariTalk Batch API

    main

    Maritaca's Batch API allows you to perform high-volume, asynchronous operations. It is divided into two main functional areas:

    1. Files (/api/files): Used to store, retrieve, download, or delete files (such as .jsonl, .csv, or .txt) that serve as inputs for batch jobs.
    2. Batch Inference (/api/batches): Used to run asynchronous jobs in bulk using previously uploaded files.

    Base URL: https://chat.maritaca.ai

  3. Available Sabiá models and use cases

    main

    Maritaca AI provides several models in the Sabiá family, optimized for different balances of intelligence, speed, and cost.

    • Sabiá 4 Thinking: A reasoning model for complex tasks (multi-step problem solving, legal analysis, agentic workflows). Supports up to 1 million tokens of context. Use model name sabia-4-thinking.
    • Sabiá 4: A general-purpose model focused on agentic capability and Brazilian context. Recommended for drafting briefs, tutoring, and synthesizing long documents. Use model name sabia-4 or sabia-4-2026-01-06.
    • Sabiazinho 4: Optimized for speed and low cost in large-scale applications. Best for information extraction, classification, and fast agentic automations. Use model names sabiazinho-4, sabiazinho-4-2026-01-06, sabia-4-small, or sabiazim-4.

    Note: Models with the suffix -br-sp (e.g., sabia-4-thinking-br-sp, sabia-4-br-sp, sabiazinho-4-br-sp) ensure 100% of inference and processing occurs within Brazilian territory for data residency/sovereignty requirements, but they are priced 30% higher.

  4. Compare Sabiá 4 performance and cost

    main

    Sabiá 4 is optimized for Brazilian legal, educational, and institutional applications. It provides high accuracy on Brazilian legislation and improved agentic capabilities compared to previous versions (Sabiá 3.1).

    Key Performance Areas:

    • Brazilian Laws: High accuracy in knowledge of Brazilian legislation.
    • Legal Tasks: Strong performance in OAB (lawyer) and Magis (judge) benchmarks.
    • Agentic Capabilities: Improved tool use and environment interaction in Portuguese.
    • Brazilian Exams: High accuracy across various national exams (ENEM, USP, etc.).
    • Conversational Skills: Evaluated via BRACEval for Portuguese proficiency.

    Sabiá 4 is positioned as a balanced choice for local context needs with a cost profile significantly lower than many global frontier models.

  5. What is the Batch API and when to use it

    main

    The Batch API is an asynchronous request mode designed for high-volume workloads that do not require immediate responses. It offers up to 50% cost reductions compared to standard requests.

    Key Characteristics

    • Cost & Limits: Billing occurs per token, but rate limits are calculated by characters per day.
      • Tiers 1-5: 1.2 billion characters/day (~300M tokens).
      • Tier 0: 4 million characters/day (~1M tokens).
      • Only input tokens count toward the rate limit.
    • Latency: Requests can take up to 24 hours to complete.
    • Expiration: Batches expire if not finished within the 24-hour window. Use with caution for critical scenarios.

    Ideal Use Cases

    • Translation or mass text review
    • Large-scale evaluations
    • Dataset classification
    • Document summarization
    • Entity and keyword extraction
  6. Understand MariTalk usage tiers and upgrades

    main

    MariTalk uses a tiered system where higher usage and spending automatically promote you to higher tiers with increased rate limits.

    Important: Initial credits and coupons do not count towards tier upgrades; only actual API spending contributes to moving to the next tier.

    Tier Requirements

    • Tier 0: R$ 0 (To start testing)
    • Tier 1: Any amount of paid usage
    • Tier 2: R$ 100 spending
    • Tier 3: R$ 500 spending
    • Tier 4: R$ 2,000 spending
    • Tier 5: R$ 5,000 spending
  7. Expected performance for Sabiá-2 models

    main

    Performance varies based on the model version and available GPU hardware. Below are typical performance expectations:

    Sabiá-2 Small

    • On 1x A100 40GB: Expect ~118 tokens/s (total) for a 500 input / 100 output request (approx. 5 seconds total).
    • On 2x A100 40GB: Higher throughput than single GPU setups.
    • On 1x A10 24GB: Lower throughput, approximately 89.8 total tokens/s.
    • Memory Requirement: ~20GB.

    Sabiá-2 Medium

    • On 2x A100 40GB: Expect ~79.3 total tokens/s. A request with 500 input / 100 output tokens takes approximately 10 seconds.
    • Memory Requirement: ~70GB.

    Note: As concurrency increases, total system throughput typically increases, but individual request latency (time to finish) also increases.

  8. Understand how cache discounts interact with other discounts

    main

    The 75% cache discount applies specifically to cached input tokens. Other discounts (Batch API, Flex, and off-peak) apply to non-cached input tokens and output tokens.

    Note that Batch, Flex, and off-peak discounts are mutually exclusive; only one of them is applied per request. They do not multiply with each other, but they can coexist with the cache discount on different token types.

    ScenarioNon-cached input and outputCached tokens
    Batch + cache50% discount75% discount
    Flex + cache50% discount75% discount
    Off-peak + cache30% discount75% discount
    Off-peak + FlexFlex only (50%)—
    Off-peak + BatchBatch only (50%)—
    Cache onlyno discount75% discount
  9. Compare Responses API vs. Chat Completions API

    main

    While the Chat Completions API remains available, the Responses API is the recommended interface for new projects. Key differences include:

    AspectChat CompletionsResponses API
    EndpointPOST /v1/chat/completionsPOST /v1/responses
    Inputmessages (list of messages)input (string or list of items)
    System instructionsVia message with role: "system"Dedicated instructions parameter
    Outputchoices[0].message.contentoutput[0].content[0].text
    Streaming(chat.completion.chunk)(response.output_text.delta, response.completed, etc.)
    Function callingVia tool_calls in messageTyped function_call items in output
    Structured outputsresponse_formattext.format with json_schema
  10. Hardware requirements for MariTalk Local

    main

    MariTalk Local runs on 64-bit Linux machines with one or more NVIDIA GPUs (Compute Capability 8.0+). Memory requirements vary by model:

    ModelMin GPU MemoryMin CPU MemoryTested GPUs
    Sabiá-2 Small24GB20GBA100, A10, A6000, L4
    Sabiá-2 Medium70GB70GB2xA100 40GB, 2xA6000 48GB

    Notes:

    • GPU memory can be distributed across multiple devices (e.g., for Medium, you can use one 80GB A100, two 40GB A100s, or four 24GB A10s).
    • CPU memory is required for model processing before transfer to GPU; this memory is released after loading.
  11. Understand Sabiá 4 Thinking reasoning model

    main

    Sabiá 4 Thinking is the reasoning-specialized model within the Sabiá family. It is designed to achieve frontier-level quality specifically for Portuguese and Brazilian contexts.

    Key characteristics include:

    • High Performance: Significant gains in tool use (function calling), legal tasks, and overall answer quality compared to the standard Sabiá 4.
    • Cost Efficiency: It is significantly more affordable than leading frontier models. Running a full suite of benchmarks on Sabiá 4 Thinking costs less than half of GPT-5.4 and approximately one-third of Opus 4.8.