Skip to content

Getting Started with Octagon Agents API

Quick Start

1. Get an API Key

To use the Octagon Agents API, you'll need an API key. You can get one by:

  1. Signing up for an Octagon account
  2. Go to the Settings page
  3. Navigate to the API Keys section
  4. Create a new API key

2. Make Your First API Call

Here's how to analyze SEC filings using different programming languages:

Python
from openai import OpenAI

client = OpenAI(
    api_key="your-octagon-api-key",  # Replace with your actual API key
    base_url="https://api.octagonagents.com/v1"
)

response = client.responses.create(
    model="octagon-sec-agent",
    instructions="You analyze SEC filings and extract financial data.",
    input="What were Apple's revenue numbers in Q3 2023?",
    stream=True
)

for event in response:
    # Print each event as it arrives
    print(event)
    
    # For text output, you can extract and process the text
    if event.type == "response.output_text.delta":
        print(event.delta, end="")
JavaScript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: "your-octagon-api-key", // Replace with your actual API key
  baseURL: "https://api.octagonagents.com/v1"
});

async function getResponse() {
  const response = await client.responses.create({
    model: "octagon-sec-agent",
    instructions: "You analyze SEC filings and extract financial data.",
    input: "What were Apple's revenue numbers in Q3 2023?",
    stream: true
  });

  for await (const event of response) {
    // Print each event as it arrives
    console.log(event);
    
    // For text output, you can extract and process the text
    if (event.type === "response.output_text.delta") {
      process.stdout.write(event.delta);
    }
  }
}

getResponse();
cURL
curl https://api.octagonagents.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-octagon-api-key" \
  -d '{
    "model": "octagon-sec-agent",
    "instructions": "You analyze SEC filings and extract financial data.",
    "input": "What were Apple'\''s revenue numbers in Q3 2023?",
    "stream": true
  }' \
  --no-buffer

Next Steps

Support

If you need help with the Octagon Agents API, you can: