Anthropic Protocol
Use this protocol with Claude Code, Anthropic SDKs and Messages API clients.
Base URL
https://api.noflex.workcURL
bash
curl https://api.noflex.work/v1/messages \
-H "x-api-key: sk-your-flex247-key" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "your-claude-model-id",
"max_tokens": 512,
"messages": [{"role": "user", "content": "Return only OK"}]
}'JavaScript / TypeScript
bash
npm install @anthropic-ai/sdkjs
import Anthropic from '@anthropic-ai/sdk'
const client = new Anthropic({
apiKey: process.env.FLEX247_API_KEY,
baseURL: 'https://api.noflex.work'
})
const message = await client.messages.create({
model: 'your-claude-model-id',
max_tokens: 512,
messages: [{ role: 'user', content: 'Review this API design.' }]
})
console.log(message.content[0].text)Python
bash
pip install anthropicpython
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ["FLEX247_API_KEY"],
base_url="https://api.noflex.work",
)
message = client.messages.create(
model="your-claude-model-id",
max_tokens=512,
messages=[{"role": "user", "content": "Summarize this change."}],
)
print(message.content[0].text)Common configuration mistakes
- Avoid a duplicated
/v1/v1inANTHROPIC_BASE_URL. - Use the complete model ID shown in Flex247 Model Square.
- Remove whitespace around
x-api-keyorANTHROPIC_AUTH_TOKEN. - If the client supports only OpenAI-style requests, use OpenAI Compatible.