# @standardagents/groq

Groq provider package for Standard Agents using the official groq-sdk

> **Info:**
>
> For direct access, set `GROQ_API_KEY` in your environment. Standard Agents Builder can use hosted routing through `STANDARD_AGENTS_API_KEY` when the provider key is absent. Hosted access depends on platform configuration.

## Overview

The `@standardagents/groq` package provides a Standard Agents provider for Groq's chat completions API. It uses the official `groq-sdk`, supports streaming, reasoning-capable models, tool calling, and model discovery through Groq's models API.

- Key Features

  - Official `groq-sdk` integration
  - Tool calling and structured outputs
  - Reasoning support for `gpt-oss-*` and `qwen/qwen3-32b`
  - Vision input support for Groq multimodal models
  - Built-in pricing for documented Groq models in request logs

## Installation

```bash pnpm
pnpm add @standardagents/groq
```

## Quick Start

```typescript
import { defineModel } from '@standardagents/spec';
import { groq } from '@standardagents/groq';

export default defineModel({
  name: 'groq-fast',
  provider: groq,
  model: 'llama-3.1-8b-instant',
  providerOptions: {
    reasoning_format: 'parsed',
  },
});
```

## Common Models

- `llama-3.1-8b-instant`
- `llama-3.3-70b-versatile`
- `meta-llama/llama-4-scout-17b-16e-instruct`
- `moonshotai/kimi-k2-instruct`
- `openai/gpt-oss-120b`
- `openai/gpt-oss-20b`
- `qwen/qwen3-32b`

## Provider Options

Use `reasoning_format`, `reasoning_effort`, `citation_options`, `service_tier`, `disable_tool_validation`, `search_settings`, and `documents` to access Groq-specific behavior.

## Environment Setup

```bash .dev.vars
GROQ_API_KEY=...
```

Streaming usage reads the final Groq metadata frame.
Token counts include cached input and reasoning output when Groq reports them.
