PageSourceSearch

https://orygofrontend-production.up.railway.app/_next/static/chunk…/agents/[agent_id]/api-9426382cb164bef6.js

js orygofrontend-production.up.railway.app collected 2026-10-03 12:13:35 UTC 8,225 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8563],{32485:(e,n,t)=>{"use strict";t.d(n,{h:()=>r});let r=(0,t(57175).B)("div",{base:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});r.displayName="Spacer"},52348:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/agents/[agent_id]/api",function(){return t(59335)}])},59335:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>h});var r=t(37876),s=t(19277),o=t(43123),a=t(39822),i=t(20529),l=t(8091),d=t(32485);t(14232);var u=t(52807),p=t(67878),c=t(54616),g=t(90096);let h=(0,s.A)(function(){let e=(0,g._)();return(0,r.jsx)(c.G,{scope:"agent_config",excludeRoles:[3],children:(0,r.jsx)(o.s,{w:"100%",flexDirection:"column",alignItems:"center",children:(0,r.jsxs)(a.a,{w:"100%",position:"relative",children:[(0,r.jsx)(i.D,{size:"lg",mb:"4",children:"API"}),(0,r.jsx)(u.A,{agentId:e}),(0,r.jsx)(l.w,{my:"6"}),(0,r.jsx)(p.A,{}),(0,r.jsx)(d.h,{my:"2rem"})]})})})})},67878:(e,n,t)=>{"use strict";t.d(n,{A:()=>p});var r=t(37876);t(14232);var s=t(39822),o=t(14741),a=t(53224),i=t(12324),l=t(82703);let d="https://orygobackend-production.up.railway.app",u="# Orygo AI — Agent API\n\n## Overview\n\nCall one agent over HTTP from your own backend. Each API key belongs to a single agent. Create and revoke keys in the panel above.\n\n**Base URL**\n\n```\n".concat(d,"\n```\n\nCall this API from your server. Do not put the key in browser or mobile client code.\n\n---\n\n## Authentication\n\nSend the key in the `Authorization` header. A key created for one agent returns 403 if it is used with another agent's URL.\n\n```\nAuthorization: Bearer sk_live_YOUR_KEY\n```\n\n---\n\n## POST /v1/agents/{agent_id}/chat\n\nStream a chat response token by token (Server-Sent Events).\n\n### Request\n\n| Parameter | In | Type | Required | Description |\n|-----------|-----|------|----------|-------------|\n| `Authorization` | Header | string | Yes | `Bearer sk_live_...` |\n| `agent_id` | Path | string | Yes | The agent this key belongs to. |\n| `message` | Body | string | Yes | The user's message. |\n| `session_id` | Body | string | No | Continue this conversation. Omit to start a new one. |\n| `external_user_id` | Body | string | No | Your own user id. Later calls with the same id resume that conversation. |\n| `message_id` | Body | string | No | Your id for this message. A UUID is generated 
1when omitted. |\n| `customer` | Body | object | No | Optional `email`, `name`, and `phone` shown in the inbox. |\n\n### Example\n\n```bash\ncurl -N -X POST \"").concat(d,'/v1/agents/AGENT_ID/chat" \\\n  -H "Authorization: Bearer sk_live_YOUR_KEY" \\\n  -H "Content-Type: application/json" \\\n  -d \'{\n    "message": "How can I return an order?",\n    "external_user_id": "user_42",\n    "customer": { "email": "[email protected]", "name": "Ada" }\n  }\'\n```\n\n### Response\n\n`Content-Type: text/event-stream`\n\nEach event is a JSON object in a `data:` line.\n\n| Event | Payload | Description |\n|-------|---------|-------------|\n| `session` | `{ "session_id" }` | Conversation id. Send it back as `session_id` to continue. |\n| `delta` | `{ "text" }` | One piece of the assistant reply. Concatenate `text` values. |\n| `done` | `{ "session_id", "message_id" }` | The turn finished. |\n| `error` | `{ "error" }` | The turn failed (for example, not enough credits). |\n| `live_handover` | `{ "session_id" }` | A human operator took over. Poll the messages endpoint for their replies. |\n\n### Error responses\n\nThese are HTTP statuses, before the stream opens.\n\n| Status | Detail |\n|--------|--------|\n| 401 | Invalid or revoked API key. |\n| 403 | The key does not belong to this agent. |\n| 404 | Agent or session not found. |\n| 409 | `conversation_stop_ai` (a human owns the thread) or `session_expired` (start a new session). |\n| 429 | `rate_limited`. |\n\n---\n\n## GET /v1/agents/{agent_id}/sessions/{session_id}/messages\n\nFull transcript for this session, including operator replies after a handover. Same `Authorization` header.\n\n```bash\ncurl "').concat(d,'/v1/agents/AGENT_ID/sessions/SESSION_ID/messages" \\\n  -H "Authorization: Bearer sk_live_YOUR_KEY"\n```\n\nEach message has `sender` `human`, `AI`, or `operator`.\n\n---\n\n## Tips\n\n- Keep using the same `session_id` or `external_user_id` so the agent remembers the conversation.\n- After `session_expired`, omit `session_id` and call again. The same `external_user_id` starts a new conversation.\n- After `live_handover` or `conversation_stop_ai`, read operator replies with the messages endpoint.\n');function p(){let{resolvedTheme:e}=(0,l.j)();return(0,r.jsx)(s.a,{w:"100%",maxW:"900px",children:(0,r.jsx)(o.oz,{remarkPlugins:[a.A],components:(0,i.A)({},void 0,!1,e||"dark","sm",!0),children:u})})}},77362:(e,n,t)=>{"use strict";t.d(n,{p:()=>p});var r=t(37876),s=t(5661),o=t(14232),a=t(61112),i=t(8641);let l=(0,o.forwardRef)((e,n)=>{let t=(0,i.f)(),o=(0,s.v6)(t?.getInputProps(),e);return(0,r.jsx)(a.X.input,{...o,ref:n})});l.displayName="FieldInput";let{withContext:d,PropsProvider:u}=(0,t(68391).a)({key:"input"}),p=d(l)},97120:(e,n,t)=>{"use strict";t.d(n,{Xi:()=>X,R4:()=>Y,tK:()=>z,Cf:()=>B,Es:()=>H,c7:()=>U,Dz:()=>O});var r=t(37876),s=t(5661),o=t(31889),a=t(18249);let[i,l]=(0,o.q)({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),d=e=>(0,a.P)()(e,["lazyMount","unmountOnExit"]);var u=t(10677),p=t(1089),c=t(13513);let[g,h]=(0,o.q)({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"});var v=t(67438),m=t(707),f=t(14232),_=t(60669),x=t(29739),y=t(61112);let w=(0,f.forwardRef)((e,n)=>{let t=h(),o=(0,c.c)(),a=(0,s.v6)({...t.getTriggerProps(),"aria-controls":o.unmounted?void 0:t.getTriggerProps()["aria-controls"]},e);return(0,r.jsx)(y.X.button,{...a,ref:n})});w.displayName="DialogTrigger";let A=(0,f.forwardRef)((e,n)=>{let t=h(),o=(0,s.v6)(t.getPositionerProps(),e);return(0,c.c)().unmounted?null:(0,r.jsx)(y.X.div,{...o,ref:n})});A.displayName="DialogPositioner";var P=t(80134);let k=(0,f.forwardRef)((e,n)=>{let t=h(),o=(0,c.c)(),a=(0,s.v6)(t.getContentProps(),o.getPresenceProps(),e);return o.unmounted?null:(0,r.jsx)(y.X.div,{...a,ref:(0,P.t)(o.ref,n)})});k.displayName="DialogContent";let j=(0,f.forwardRef)((e,n)=>{let t=h(),o=(0,s.v6)(t.getDescriptionProps(),e);return(0,r.jsx)(y.X.div,{...o,ref:n})});j.displayName="DialogDescription";let T=(0,f.forwardRef)((e,n)=>{let t=h(),o=(0,s.v6)(t.getTitleProps(),e);return(0,r.jsx)(y.X.h2,{...o,ref:n})});T.displayName="DialogTitle";let N=(0,f.forwardRef)((e,n)=>{let t=h(),o=(0,s.v6)(t.getCloseTriggerProps(),e);return(0,r.jsx)(y.X.button,{...o,ref:n})});N.displayName="DialogCloseTrigger";let C=(0,f.forwardRef)((e,n)=>{let t=h(),o=l(),a=(0,p.x)({...o,present:t.open}),i=(0,s.v6)(t.getBackdropProps(),a.getPresenceProps(),e);return a.unmounted?null:(0,r.jsx)(y.X.div,{...i,ref:(0,P.t)(a.ref,n)})});C.displayName="DialogBackdrop";var b=t(5794),D=t(57175);let{withRootProvider:E,withContext:R,useStyles:I,PropsProvider:S}=(0,b.c)({key:"dialog"});E(e=>{let[n,{value:t,children:o}]=(0,u.s)(e),[a]=d(n),l=(0,p.x)((0,s.v6)({present:t.open},n));return(0,r.jsx)(g,{value:t,children:(0,r.jsx)(i,{value:a,children:(0,r.jsx)(c.j,{value:l,children:o})})})},{defaultProps:{unmountOnExit:!0,lazyMount:!0}});let O=E(e=>{let[n,{children:t,...o}]=(0,u.s)(e),[a]=d(n),l=(e=>{let n=(0,f.useId)(),{getRootNode:t}=(0,_.w)(),{dir:r}=(0,x.g)(),s={id:n,getRootNode:t,dir:r,...e},o=(0,m.zl)(v.Aq,s);return v.Ng(o,m._B)})(o),h=(0,p.x)((0,s.v6)({present:l.open},n));return(0,r.jsx)(g,{value:l,children:(0,r.jsx)(i,{value:a,children:(0,r.jsx)(c.j,{value:h,children:t})})})},{defaultProps:{unmountOnExit:!0,lazyMount:!0}});R(w,"trigger",{forwardAsChild:!0}),R(A,"positioner",{forwardAsChild:!0});let B=R(k,"content",{forwardAsChild:!0});R(j,"description",{forwardAsChild:!0}),R(T,"title",{forwardAsChild:!0});let z=R(N,"closeTrigger",{forwardAsChild:!0});(0,f.forwardRef)(function(e,n){let t=h();return(0,r.jsx)(D.B.button,{...e,ref:n,onClick:()=>t.setOpen(!1)})});let X=R(C,"backdrop",{forwardAsChild:!0}),Y=R("div","body"),H=R("div","footer"),U=R("div","header")}},e=>{e.O(0,[3302,4e3,5276,4112,2324,7682,636,6593,8792],()=>e(e.s=52348)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.