How is your experience with the OutSystems Community?
45
Views
3
Comments
How can I integrate Claude with OutSystems 11 (O11)?
Application Type
Reactive

I want to connect Claude AI to my OutSystems 11 Personal Environment. Could you please explain the integration process step by step?

If possible, could you also provide an OML file that I can import into OutSystems Service Studio and use as a reference to understand how to connect Claude AI with my OutSystems application?

Please explain each step in detail, including API configuration, authentication, REST API integration, and how to display Claude's responses on an OutSystems screen.

Thank you for your help!

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
2026-05-10 20-22-56
Rashid Al-Aamri

Hi Sunil,

The MCP links above are about letting Claude work on your code in Service Studio. If what you want is for your app to call Claude at runtime (user types a prompt, the screen shows Claude's answer), you consume the Anthropic Messages API as a regular REST API. Steps:

1. Get an API key
Create one in the Claude Console (console.anthropic.com). Never put it in client-side logic. Store it in a Site Property (e.g. ClaudeApiKey, Text) and set its value in Service Center, so it only lives on the server.

2. Consume the REST method
Logic tab > Integrations > REST > right-click > Consume REST API > Add single method.
- Method: POST https://api.anthropic.com/v1/messages
- Headers: x-api-key (make it an input parameter), anthropic-version: 2023-06-01, content-type: application/json
- Request body example:
{"model":"MODEL_ID","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}
- Response body example:
{"id":"msg_01","type":"message","role":"assistant","content":[{"type":"text","text":"Hi! How can I help?"}],"stop_reason":"end_turn","usage":{"input_tokens":10,"output_tokens":8}}
Click Test with your key, then Copy to response body, and Finish. Service Studio generates the request/response structures for you. Replace MODEL_ID with a current model ID from the models page in Anthropic's docs (docs.claude.com).

3. Wrap it in a server action
Create AskClaude (input Prompt, output Answer):
- Build the request: model, max_tokens, and a Messages list with one item (role = "user", content = Prompt).
- Call the REST method, passing Site.ClaudeApiKey to the x-api-key header.
- Assign Answer = Response.content.Current.text (or loop the content list and concatenate the items where type = "text").

4. Show it on a screen
Screen with a local variable Prompt bound to an Input (or Text Area), a local variable Answer, a Button whose client action calls AskClaude and assigns the output to Answer, and an Expression showing Answer. For a chat, keep a list of {role, content} records, append the user message and Claude's reply each turn, and send the whole list in messages so Claude has the conversation context.

5. Things to handle
- Errors: 401 = bad key, 429 = rate limit, 529 = overloaded. Add an Exception Handler and show a friendly message.
- Long answers can take a while: raise the REST method Timeout if needed and show a loading state on the button.
- Optional: the system field in the body lets you give Claude instructions for your app (tone, language, what it should and shouldn't answer).

Hope this helps!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.