Appearance
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:
- Signing up for an Octagon account
- Go to the Settings page
- Navigate to the API Keys section
- 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
- Learn about Authentication and security best practices
- Explore the Available Specialized Agents to find the right one for your research needs
- Understand how to Handle Streaming Responses for a better user experience
- Discover how to Use AI Coding Tools to generate integration code
- See the complete Investment Research API Reference for detailed endpoint documentation
- Learn how to create multi-agent workflows with the OpenAI Agents SDK
Support
If you need help with the Octagon Agents API, you can:
- Contact support at support@octagonai.co