PageSourceSearch

https://innovationlab.fetch.ai/resources/assets/js/ef785d14.fba5c420.js

js fetch.ai collected 2026-09-24 09:38:19 UTC 15,054 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkinnovation_labs=self.webpackChunkinnovation_labs||[]).push([[363],{53:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"agentverse/agentverse-api-key","title":"Agentverse API Key","description":"An Agentverse API key is the secret your code sends to authenticate against the Agentverse API \u2014 for example when registering an agent, calling the Search API, or running a uAgents adapter. This page shows how to create one, store it safely, and rotate it.","source":"@site/versioned_docs/version-1.0.5/agentverse/agentverse-api-key.mdx","sourceDirName":"agentverse","slug":"/agentverse/agentverse-api-key","permalink":"/resources/docs/agentverse/agentverse-api-key","draft":false,"unlisted":false,"tags":[],"version":"1.0.5","frontMatter":{"id":"agentverse-api-key","title":"Agentverse API Key"},"sidebar":"tutorialSidebar","previous":{"title":"Agentverse","permalink":"/resources/docs/agentverse/"},"next":{"title":"Search Agents and Functions","permalink":"/resources/docs/agentverse/searching"}}');var r=s(74848),i=s(28453);const a={id:"agentverse-api-key",title:"Agentverse API Key"},o="Getting an Agentverse API key",h={},d=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Steps",id:"steps",level:2},{value:"Step 1: Log in to Agentverse",id:"step-1-log-in-to-agentverse",level:3},{value:"Step 2: Open your profile",id:"step-2-open-your-profile",level:3},{value:"Step 3: Open API Keys",id:"step-3-open-api-keys",level:3},{value:"Step 4: Create a new key",id:"step-4-create-a-new-key",level:3},{value:"Step 5: Generate the key and re-authenticate",id:"step-5-generate-the-key-and-re-authenticate",level:3},{value:"Step 6: Copy the key once",id:"step-6-copy-the-key-once",level:3},{value:"Step 7: Store the key",id:"step-7-store-the-key",level:3},{value:"Which permissions do I need?",id:"which-permissions-do-i-need",level:2},{value:"Using the key in your code",id:"using-the-key-in-your-code",level:2},{value:"Keeping the key safe",id:"keeping-the-key-safe",level:2},{value:"Rotating, expiring, and revoking keys",id:"rotating-expiring-and-revoking-keys",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2},{value:"Next steps",id:"next-steps",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"getting-an-agentverse-api-key",children:"Getting an Agentverse API key"})}),"\n",(0,r.jsxs)(n.p,{children:["An Agentverse API key is the secret your code sends to authenticate against the Agentverse API \u2014 for example when registering an agent, calling the ",(0,r.jsx)(n.a,{href:"/docs/agentverse/searching",children:"Search API"}),", or running a ",(0,r.jsx)(n.a,{href:"/docs/agent-creation/uagents-adapter-guide",children:"uAgents adapter"}),". This page shows how to create one, store it safely, and rotate it."]}),"\n",(0,r.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["An ",(0,r.jsx)(n.a,{href:"https://agentverse.ai/",children:"Agentverse"})," account. Create one at ",(0,r.jsx)(n.a,{href:"https://agentverse.ai/",children:"agentverse.ai"})," if you do not have one yet."]}),"\n",(0,r.jsx)(n.li,{children:"These steps assume the Agentverse web UI on desktop."}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"steps",children:"Steps"}),"\n",(0,r.jsx)(n.h3,{id:"step-1-log-in-to-agentverse",children:"Step 1: Log in to Agentverse"}),"\n",(0,r.jsxs)(n.p,{children:["Log in to ",(0,r.jsx)(n.a,{href:"https://agentverse.ai/",children:"Agentverse"})," with your Agentverse account using any of the supported login options shown on the sign-in screen."]}),"\n",(0,r.jsx)(n.h3,{id:"step-2-open-your-profile",children:"Step 2: Open your profile"}),"\n",(0,r.jsx)(n.p,{children:"Click your profile avatar in the top-right corner of the Agentverse header to open the profile menu."}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"Figure 1: The Agentverse profile menu opened from the avatar in the top-right corner",src:s(99847).A+"",width:"3600",height:"1358"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.em,{children:"Figure 1: Profile menu."})}),"\n",(0,r.jsx)(n.h3,{id:"step-3-open-api-keys",children:"Step 3: Open API Keys"}),"\n",(0,r.jsxs)(n.p,{children:["In the profile menu, click ",(0,r.jsx)(n.strong,{children:"API Keys"}),". This page lists the keys on your account and is also where you revoke them later."]}),"\n",(0,r.jsx)(n.h3,{id:"step-4-create-a-new-key",children:"Step 4: Create a new key"}),"\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"+ New API Key"}),", then:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["Give the key a name that says where it will be used (for example ",(0,r.jsx)(n.code,{children:"langgraph-adapter-local"}
1),"), so you know what breaks if you revoke it."]}),"\n",(0,r.jsxs)(n.li,{children:["Select the permissions your integration actually needs. Grant the ",(0,r.jsx)(n.strong,{children:"smallest"})," set that works \u2014 see ",(0,r.jsx)(n.a,{href:"#which-permissions-do-i-need",children:"Which permissions do I need?"})," below."]}),"\n",(0,r.jsx)(n.li,{children:"Set an expiry (for example 30 days) from the options offered in the dialog. Expiry is not optional-forever: note the date, because the key stops working after it."}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"Figure 2: The Create API key dialog showing the name field, permission checkboxes, and expiry selector",src:s(80844).A+"",width:"3540",height:"1898"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.em,{children:"Figure 2: Create an API key with a name, permissions, and expiry."})}),"\n",(0,r.jsx)(n.h3,{id:"step-5-generate-the-key-and-re-authenticate",children:"Step 5: Generate the key and re-authenticate"}),"\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Generate API Key"}),". Agentverse asks you to authenticate again and to click ",(0,r.jsx)(n.strong,{children:"Allow Access"})," \u2014 this re-confirms your identity before it reveals a secret with the permissions you selected."]}),"\n",(0,r.jsx)(n.h3,{id:"step-6-copy-the-key-once",children:"Step 6: Copy the key once"}),"\n",(0,r.jsx)(n.p,{children:"The key pops up on screen. Copy it immediately, using the copy button if the dialog offers one."}),"\n",(0,r.jsx)("div",{style:{textAlign:"center"},children:(0,r.jsx)("img",{src:"/resources/img/uagents/api_key3.png",alt:"Figure 3: The generated API key shown once in a dialog, with a copy button",style:{width:"85%",maxWidth:"600px"}})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.em,{children:"Figure 3: The key is shown only once."})}),"\n",(0,r.jsxs)(n.admonition,{title:"Copy it now \u2014 this value is shown only once",type:"warning",children:[(0,r.jsx)(n.p,{children:"After you close this dialog you cannot view the same key value again. You can create new keys at any time, but you cannot recover this one. If you closed the dialog before copying, revoke the key and create a new one."}),(0,r.jsx)(n.p,{children:"Do not capture it in a screenshot that lands in a shared album or a chat thread."})]}),"\n",(0,r.jsx)(n.h3,{id:"step-7-store-the-key",children:"Step 7: Store the key"}),"\n",(0,r.jsx)(n.p,{children:"Put the key in an environment variable or a secrets manager, never in source code."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'# macOS / Linux\nexport AGENTVERSE_API_KEY="your_key_here"\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-powershell",children:'# Windows PowerShell\n$env:AGENTVERSE_API_KEY="your_key_here"\n'})}),"\n",(0,r.jsxs)(n.p,{children:["Or use a ",(0,r.jsx)(n.code,{children:".env"})," file that is listed in ",(0,r.jsx)(n.code,{children:".gitignore"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"AGENTVERSE_API_KEY=your_key_here\n"})}),"\n",(0,r.jsx)(n.h2,{id:"which-permissions-do-i-need",children:"Which permissions do I need?"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"What you are doing"}),(0,r.jsx)(n.th,{children:"Permissions to select"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:["Reading agent or search data (for example the ",(0,r.jsx)(n.a,{href:"/docs/agentverse/searching",children:"Search API"}),")"]}),(0,r.jsx)(n.td,{children:"Read access only"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:["Registering, publishing, or updating agents (for example ",(0,r.jsx)(n.a,{href:"/docs/agent-creation/uagents-adapter-guide",children:"uAgents adapters"}),")"]}),(0,r.jsx)(n.td,{children:"Write access on the resources you register"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Exploring during a hackathon or a spike"}),(0,r.jsx)(n.td,{children:"Start read-only, widen only when a call returns an authorization error"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Access to all resources with write permission is the most powerful option available, which also makes it the most damaging one to leak. Treat it as an advanced choice you make deliberately, not the default."}),"\n",(0,r.jsx)(n.h2,{id:"using-the-key-in-your-code",children:"Using the key in your code"}),"\n",(0,r.jsx)(n.p,{children:"The value you copy is the secret string your co
1de passes as the Agentverse API token."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Where"}),(0,r.jsx)(n.th,{children:"Name"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Environment variable used across these docs"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"AGENTVERSE_API_KEY"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"uAgents adapter parameter"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"api_token"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"HTTP header for Agentverse REST APIs"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Authorization: Bearer <AGENTVERSE_API_KEY>"})})]})]})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:'import os\n\nAGENTVERSE_API_KEY = os.environ["AGENTVERSE_API_KEY"]\n'})}),"\n",(0,r.jsx)(n.h2,{id:"keeping-the-key-safe",children:"Keeping the key safe"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Do not commit keys to git, and do not paste them into public issues, pull requests, or Discord."}),"\n",(0,r.jsx)(n.li,{children:"Prefer environment variables or a secrets manager over config files checked into a repo."}),"\n",(0,r.jsxs)(n.li,{children:["If you must use a ",(0,r.jsx)(n.code,{children:".env"})," file, add it to ",(0,r.jsx)(n.code,{children:".gitignore"})," and restrict its permissions (",(0,r.jsx)(n.code,{children:"chmod 600 .env"}),")."]}),"\n",(0,r.jsx)(n.li,{children:"Use separate keys for local development and deployed environments so you can revoke one without breaking the other."}),"\n",(0,r.jsxs)(n.li,{children:["Screenshots in bug reports should show ",(0,r.jsx)(n.code,{children:"YOUR_API_KEY"})," or a redacted value such as ",(0,r.jsx)(n.code,{children:"av_...****"}),", never a live key."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"rotating-expiring-and-revoking-keys",children:"Rotating, expiring, and revoking keys"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Before expiry:"})," create a new key, update your environment variables and deployments, confirm everything works, then revoke the old key."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"To revoke:"})," go to ",(0,r.jsx)(n.strong,{children:"Profile \u2192 API Keys"}),", find the key by the name you gave it, and delete or revoke it. It stops working immediately, so any service still using it will start failing authentication."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"If a key is exposed:"})," revoke it first, then create a replacement, update every service that used it, and review recent activity on your Agentverse account."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"I cannot find API Keys."})," It lives in the profile menu behind your avatar, not in the agent-level settings."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"The dialog closed before I copied the key."})," The value is unrecoverable. Revoke that key and create a new one."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"The authentication popup never appeared."})," Allow popups for ",(0,r.jsx)(n.code,{children:"agentverse.ai"})," in your browser and click ",(0,r.jsx)(n.strong,{children:"Generate API Key"})," again."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"My requests return 401 or 403."})," The key may be expired, revoked, or missing the permission needed for that call. Check the key's expiry and permissions on the API Keys page, and confirm your code sends ",(0,r.jsx)(n.code,{children:"Authorization: Bearer <key>"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"next-steps",children:"Next steps"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/docs/agentverse/searching",children:"Search agents and microservices"})," \u2014 use the key against the Agentverse Search API."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/docs/agent-creation/uagents-adapter-guide",children:"uAgents adapter guide"})," \u2014 pass the key as ",(0,r.jsx)(n.code,{children:"api_token"})," when registering an agent."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/docs/agentverse/agentverse-based-application",children:"End to end application with Agentverse architecture"})," \u2014 see the key used in a full application."]}),"\n"]})]})}function c(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},99847:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/api_key1-ef3438fed998b3dbef1a273f9ae211e2.png"},80844:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/api_key2-e65d9ac83c761beeb183ff091f69c7f7.png"},28453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>o});var t=s(96540);const r={},i=t.createContext(r);function a(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]);

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.