"use strict"; (self.webpackChunkdocusaurus_template_openapi_docs = self.webpackChunkdocusaurus_template_openapi_docs || []).push([[8818], { 57461: (t, e, a) => { a.r(e), a.d(e, { assets: () => l, contentTitle: () => r, default: () => c, frontMatter: () => o, metadata: () => s, toc: () => p }); var i = a(87462), n = (a(67294), a(3905)); const o = { id: "http", sidebar_position: 3 }, r = "Using AON with HTTP", s = { unversionedId: "quick-start/http", id: "quick-start/http", title: "Using AON with HTTP", description: "Authentication", source: "@site/docs/quick-start/http.md", sourceDirName: "quick-start", slug: "/quick-start/http", permalink: "/quick-start/http", draft: !1, tags: [], version: "current", sidebarPosition: 3, frontMatter: { id: "http", sidebar_position: 3 }, sidebar: "tutorialSidebar", previous: { title: "Using AON with Python", permalink: "/quick-start/python_sdk" }, next: { title: "Public Models API", permalink: "/category/public-models-api" } }, l = {}, p = [{ value: "Authentication", id: "authentication", level: 2 }, { value: "For API Key", id: "for-api-key", level: 3 }, { value: "For JWT Token", id: "for-jwt-token", level: 3 }, { value: "Create a prediction", id: "create-a-prediction", level: 2 }, { value: "For API Key", id: "for-api-key-1", level: 3 }, { value: "For JWT Token", id: "for-jwt-token-1", level: 3 }], u = { toc: p }; function c(t) { let { components: e, ...a } = t; return (0, n.kt)("wrapper", (0, i.Z)({}, u, a, { components: e, mdxType: "MDXLayout" }), (0, n.kt)("h1", { id: "using-aigic-with-http" }, "Using AON with HTTP"), (0, n.kt)("h2", { id: "authentication" }, "Authentication"), (0, n.kt)("p", null, "All API requests must be authenticated. Include authenticated in header with all requests."), (0, n.kt)("p", null, "You can choose either API key or JWT token for authentication."), (0, n.kt)("h3", { id: "for-api-key" }, "For API Key"), (0, n.kt)("pre", null, (0, n.kt)("code", { parentName: "pre", className: "language-shell" }, 'header = {\n    apikey:"your api key"\n}\n')), (0, n.kt)("h3", { id: "for-jwt-token" }, "For JWT Token"), (0, n.kt)("pre", null, (0, n.kt)("code", { parentName: "pre", className: "language-shell" }, 'header = {\n    Authorization:"Bearer your jwt token"\n}\n')), (0, n.kt)("h2", { id: "create-a-prediction" }, "Create a prediction"), (0, n.kt)("h3", { id: "for-api-key-1" }, "For API Key"), (0, n.kt)("p", null, "When using API key for authentication, the base path of the HTTP request is 'api'."), (0, n.kt)("pre", null, (0, n.kt)("code", { parentName: "pre", className: "language-shell" }, "POST https://api.aonet.ai/api/v1/predictions/ai/bark\n")), (0, n.kt)("p", null, "Example cURL request:"), (0, n.kt)("pre", null, (0, n.kt)("code", { parentName: "pre", className: "language-javascript" }, "curl -X POST \\\n  https://api.aonet.ai/api/v1/predictions/ai/bark \\\n  -H 'Cache-Control: no-cache' \\\n  -H 'Content-Type: application/json' \\\n  -H 'apikey: <your api key>' \\\n  -d '{\n    \"input\":{\n      \"prompt\": \"Hello, my name is Suno. And, uh \u2014 and I like pizza. [laughs] But I also have other interests such as playing tic tac toe.\"\n    }\n}'\n")), (0, n.kt)("h3", { id: "for-jwt-token-1" }, "For JWT Token"), (0, n.kt)("p", null, "When using JWT Tokwn for authentication, the base path of the HTTP request is 'jwt'."), (0, n.kt)("pre", null, (0, n.kt)("code", { parentName: "pre", className: "language-shell" }, "POST https://api.aonet.ai/jwt/v1/predictions/ai/bark\n")), (0, n.kt)("p", null, "Example cURL request:"), (0, n.kt)("pre", null, (0, n.kt)("code", { parentName: "pre", className: "language-javascript" }, "curl -X POST \\\n  https://api.aonet.ai/jwt/v1/predictions/ai/bark \\\n  -H 'Cache-Control: no-cache' \\\n  -H 'Content-Type: application/json' \\\n  -H 'Authorization: Bearer <your jwt token>' \\\n  -d '{\n    \"input\":{\n      \"prompt\": \"Hello, my name is Suno. And, uh \u2014 and I like pizza. [laughs] But I also have other interests such as playing tic tac toe.\"\n    }\n}'\n"))) } c.isMDXComponent = !0 } }]);