```javascript
const GROQ_API_KEY = process.env.GROQ_API_KEY;

async function main() {
  try {
    const response = await fetch('https://api.groq.com/openai/v1/chat/completions', {
      method: 'POST',
      body: JSON.stringify({
        service_tier: 'flex',
        model: 'openai/gpt-oss-20b',
        messages: [{
          role: 'user',
          content: 'whats 2 + 2'
        }]
      }),
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${GROQ_API_KEY}`
      }
    });

    const data = await response.json();

    console.log(data);
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
  }
}

main();
```

---

## Flex Processing: Example1 (json)