brain-circuitAI Platform

Information about configuring Generative AI API.

Obtaining API Key

Navigate to AI configuration managementarrow-up-right page from AI API Integration Tab. Click on "Open Service" button to enter configuration page and follow up with the confirmation.

To obtain the API key click on "View". You may have to enter your account password for verification.

Configuring AI API

API Domain: https://sgai.littlepig.cloud Endpoint: /anthropic/v1/messages Protocol: HTTPS Request Method: POST Request Body: Serialized JSON format

Request Structure

Required Headers

Header
Type
Description

x-api-key

string

Authentication key from the Console.

Content-Type

string

Must be application/json.

Request Data Definition

Parameter
Type
Required
Description

model

string

Yes

Claude model to use.

max_tokens

integer

Yes

Maximum tokens to generate.

messages

object[]

Yes

Conversation history (see Messages Format).

stream

boolean

No

Stream the response as Server-Sent Events.

system

string

No

System-level prompt.

temperature

number

No

0.0‑1.0; lower = more deterministic, higher = more creative.

top_p

number

No

Nucleus‑sampling ratio. Adjust either temperature or top_p.

tools

object[]

No

Definitions of external tools the model may call.


Single Use Case – Basic Chat


Messages Format

Text‑only (shorthand)

Explicit Content Blocks

Each input message content may be either a single string or an array of content blocks, where each block has a specific type. Using a string for content is shorthand for an array of one content block of type "text". The following input messages are equivalent:

Multiple Conversational Turns

Partially‑filled Response

Image + Text

Supported image types: image/jpeg, image/png, image/gif, image/webp.


Tool Definition Schema

If you include tools in your API request, the model may return tool_use content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using tool_result content blocks.

Field
Type
Required
Description

name

string

Yes

Tool name.

description

string

No

What the tool does.

input_schema

object

Yes

JSON schema for the tool input.


Response Data Definition

Field
Description

content

Content blocks produced by Claude.

id

Message ID.

model

Model that generated the reply.

role

Always assistant.

stop_reason

Why generation stopped (e.g. end_turn).

usage.input_tokens

Tokens in the request.

usage.output_tokens

Tokens in the response.

Example


Streaming Events (stream=true)

Event
Payload

content_block_delta

Partial token or tool‑input data.

error

Error details.

Example:

Tool invocation stream:


Tool Invocation Walk‑through


Further Reading

https://docs.anthropic.com/en/api/messagesarrow-up-right

Pricing

circle-info

The model pricing is subject to change. Please visit the configuration managementarrow-up-right page to view the latest pricing.

Model
Price / 1 000 input tokens
Price / 1 000 output tokens

claude_3_haiku

$0.00025

$0.00125

claude_3_sonnet

$0.003

$0.015

claude_3_opus

$0.015

$0.075

claude_35_haiku

$0.0008

$0.004

claude_35_sonnet

$0.003

$0.015

claude_37_sonnet

$0.003

$0.015

circle-exclamation

Last updated

Was this helpful?