DGrid AI 백서

DGrid AI

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 10쪽 중 3쪽

at) messages: [ { role: 'user', content: 'What is the meaning of life?', }, ], }); // Print the response result console.log(completion.choices[0].message); } getChatCompletion(); ``` #### Python Implementation ```python theme={null} from openai import OpenAI # Initialize the OpenAI client with DGrid AI Gateway configuration client = OpenAI( base_url="https://api.dgrid.ai/v1", # Point to DGrid AI Gateway endpoint api_key="<DGRID_API_KEY>", # Replace with your valid DGrid API key ) completion = client.chat.completions.create( extra_headers={ "HTTP-Referer": "<YOUR_SITE_URL>", # Optional: Your application's site URL "X-Title": "<YOUR_SITE_NAME>", # Optional: Your application's name }, model="openai/gpt-4o", # Specify the target model (DGrid-supported format) messages=[ { "role": "user", "content": "What is the meaning of life?" } ] ) # Print the response content print(completion.choices[0].message.content) ``` ### Additional Notes 1. **Optional Headers**: The `HTTP-Referer` and `X-Title` headers are optional, but filling them in helps DGrid better identify your application and provide more optimized service support. 2. **Model Naming Format**: The model parameter uses the format `[provider]/[model-name]` (e.g., `openai/gpt-4o`), which is consistent across all DGrid-supported models for easy switching. 3. **SDK Development Update**: The official DGrid SDK is under development and will provide more native features and optimized performance—please pay attention to the official DGrid documentation updates for release information. # Redeem a DGrid Credit Code Source: https://docs.dgrid.ai/ai-gateway/redeem-credit-code Redeem a DGrid Credit Code from the Billing page and apply the credits to your DGrid account. DGrid Credits let you access leading models on the DGrid platform. If you received a DGrid Credit Code, follow these steps to apply it to your account. <Steps> <Step title="Log in to DGrid"> Go to [DGrid](https://dgrid.ai/) and connect your wallet. <Frame> <img alt="DGrid homepage with the sign-in option" /> </Frame> </Step> <Step title="Open Billing"> Click your profile icon in the top-right corner and select **Billing**. <Frame> <img alt="Billing option in the DGrid profile menu" /> </Frame> </Step> <Step title="Validate your Credit Code"> On the **Billing** page, scroll to the **Deposit** section and click **Redeem Code**. Enter your code, then click **Validate Code**. <Frame> <img alt="Redeem Code form in the Deposit section" /> </Frame> </Step> <Step title="Confirm the redemption"> Review the code details and click **Confirm Redeem**. Your DGrid Credits are applied to your account immediately. <Frame> <img alt="DGrid Credit Code details and Confirm Redeem button" /> </Frame> </Step> </Steps> After the credits are available, you can start using DGrid. If you have trouble redeeming your code, contact the [DGrid team on Telegram](https://t.me/dgrid_ai). # Supported Countries and Regions Source: https://docs.dgrid.ai/ai-gateway/supported-regions Regional availability, supported countries, and geographic restrictions for the DGrid AI Gateway, including IP and compliance limitations. *Last updated: Wed 22 Apr* ## Overview This page describes regional availability considerations for DGrid AI Gateway ("AI Gateway"). AI Gateway may not be available in all countries, territories, or jurisdictions. Availability may vary due to legal, regulatory, sanctions, export control, infrastructure, payment, operational, security, or third-party provider constraints. This page applies specifically to AI Gateway. It does not replace any separate regional restrictions, legal notices, or product-specific terms that may apply to other DGrid offerings. For service-use requirements, see [Terms of Service](/ai-gateway/terms-of-service). ## Supported Access Regions AI Gateway is intended to be made available only in regions where DGrid determines that access and use can be supported in a lawful, operationally feasible, and commercially appropriate manner. Supported access may depend on factors including: * applicable law and regulatory requirements; * sanctions and export control obligations; * availability of infrastructure or service providers; * support coverage and operational readiness; * payment, billing, or contracting constraints; and * model, feature, or provider availability in a given region. Confirmed supported countries, regions, and territories for commercial API access are: Albania, Algeria, Andorra, Angola, Antigua and Barbuda, Argentina, Armenia, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belgium, Belize, Benin, Bhutan, Bolivia, Bosnia and Herzegovina, Botswana, Brazil, Brunei, Bulgaria, Burkina Faso, Burundi, Cabo Verde, Cambodia, Cameroon, Canada, Chad, Chile, Colombia, Comoros, Congo (Brazzaville), Costa Rica, Cote d'Ivoire, Croatia, Cyprus, Czech Republic, Denmark, Djibouti, Dominica, Dominican Republic, Ecuador, Egypt, El Salvador, Equatorial Guinea, Estonia, Eswatini, Fiji, Finland, France, Gabon, Gambia, Georgia, Germany, Ghana, Greece, Grenada, Guatemala, Guinea, Guinea-Bissau, Guyana, Haiti, Honduras, Hungary, Iceland, India, Indonesia, Iraq, Ireland, Israel, Italy, Jamaica, Japan, Jordan, Kazakhstan, Kenya, Kiribati, Kuwait, Kyrgyzstan, Laos, Latvia, Lebanon, Lesotho, Liberia, Liechtenstein, Lithuania, Luxembourg, Madagascar, Malawi, Malaysia, Maldives, Malta, Marshall Islands, Mauritania, Mauritius, Mexico, Micronesia, Moldova, Monaco, Mongolia, Montenegro, Morocco, Mozambique, Namibia, Nauru, Nepal, Netherlands, New Zealand, Niger, Nigeria, North Macedonia, Norway, Oman, Pakistan, Palau, Palestine, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Qatar, Romania, Rwanda, Saint Kitts and Nevis, Saint Lucia, Saint Vincent and the Grenadines, Samoa, San Marino, Sao Tome and Principe, Saudi Arabia, Senegal, Serbia, Seychelles, Sierra Leone, Singapore, Slovakia, Slovenia, Solomon Islands, South Africa, South Korea, Spain, Sri Lanka, Suriname, Sweden, Switzerland, Taiwan, Tajikistan, Tanzania, Thailand, Timor-Leste, Togo, Tonga, Trinidad and Tobago, Tunisia, Turkiye, Turkmenistan, Tuvalu, Uganda, Ukraine (excluding Crimea, Donetsk, Kherson, Luhansk, and Zaporizhzhia regions), United Arab Emirates, United Kingdom, United States, Uruguay, Uzbekistan, Vanuatu, Vatican City, Vietnam, Zambia, Zimbabwe. Users should refer to this page and the latest published DGrid documentation for current regional availability. ## Restricted or Unsupported Regions DGrid may restrict or decline access to AI Gateway in any country, territory, or jurisdiction where DGrid determines that access or use would create legal, regulatory, sanctions, export control, security, operational, or commercial risk. In some cases, DGrid may: * block account creation or API access; * limit use of particular models or features; * require additional verification or review; or * suspend or terminate access if continued service is not permitted or feasible. Users may not access or use AI Gateway from a restricted or unsupported region in a manner that bypasses geographic, technical, compliance, or contractual controls. ## Service Limitations by Region Even where AI Gateway is available, not all features, models, endpoints, integrations, or account options may be available in every region. Regional differences may result from: * third-party model or provider restrictions; * local compliance requirements; * data routing or infrastructure limitations; * payment or billing availability; * language or support coverage; or * operational rollout timing. DGrid reserves the right to vary, limit, or withdraw regional availability of any AI Gateway feature at any time. ## Compliance and Export Control Use of AI Gateway is subject to all applicable trade restrictions, sanctions laws, export control rules, and related regulatory requirements. You are responsible for ensuring that your access to and use of AI Gateway complies with all applicable laws and restrictions in the jurisdictions relevant to you, your organization, your users, and your use case. DGrid may require additional review, documentation, verification, or contractual assurances before enabling or continuing access in certain regions or for certain use cases. ## Changes to Regional Availability DGrid may update, expand, limit, suspend, or discontinue availability of AI Gateway in any region at any time, with or without notice, subject to applicable law. Changes may result from: * changes in law or regulation; * sanctions or export control developments; * changes in third-party provider support; * infrastructure, security, or operational issues; or * DGrid's internal compliance or risk assessments. Users should refer to the latest published DGrid documentation for current regional availability guidance. ## Contact If you need confirmation about AI Gateway availability for a specific country, territory, or use case, please contact DGrid at [hi@dgrid.ai](mailto:hi@dgrid.ai). # Terms of Service Source: https://docs.dgrid.ai/ai-gateway/terms-of-service Legal terms, acceptable use policy, and service conditions governing access to and use of the DGrid AI Gateway and Model API endpoints. *Last updated: Wed 22 Apr* ## Overview These Terms of Service ("Terms") govern access to and use of DGrid AI Gateway ("AI Gateway"), including related APIs, documentation, tools, interfaces, and service features made available by DGrid. AI Gateway is a service for accessing, routing, managing, and integrating AI model capabilities and related functionality. These Terms apply specifically to AI Gateway and related service features unless DGrid expressly states otherwise in writing. ## Scope of These Terms These Terms apply to your access to and use of AI Gateway as a service. For clarity, these Terms do not govern DGrid Premium or any DGrid Premium license-related offering unless DGrid expressly states otherwise. Separate product-specific or service-specific terms, policies, notices, or commercial terms may apply where DGrid publishes them for other offerings. By accessing or using AI Gateway, you agree to comply with these Terms and any additional documentation, policies, usage requirements, or technical guidance that DGrid may publish for AI Gateway from time to time. ## Eligibility and Compliance You may use AI Gateway only if you are authorized to do so under applicable law and, where relevant, on behalf of yourself or the legal entity you represent. You are responsible for ensuring that your access to and use of AI Gateway complies with all applicable laws, regulations, sanctions restrictions, export control requirements, and internal compliance obligations relevant to your jurisdiction, industry, and use case. DGrid may restrict, suspend, or deny access to AI Gateway where access or use would create legal, regulatory, security, or compliance risk. ## Accounts and API Credentials To access certain AI Gateway features, you may need to create an account, obtain API credentials, or use credentials issued by DGrid. You are responsible for: * maintaining the confidentiality and security of your account and API credentials; * all activity conducted under your account or credentials; * ensuring that credentials are not shared, exposed, resold, or used in an unauthorized manner; and * promptly notifying DGrid of any suspected unauthorized access, credential compromise, or misuse. DGrid may rotate, revoke, suspend, or replace credentials where reasonably necessary for security, operational, legal, or compliance purposes. ## Permitted Use Subject to these Terms, you may use AI Gateway only for lawful, authorized, and documented purposes. You may use AI Gateway in accordance with any technical documentation, usage limits, product guidance, and service-specific restrictions published by DGrid. ## Prohibited Use You may not use AI Gateway to: * violate any applicable law or regulation; * infringe, misappropriate, or otherwise violate the rights of DGrid or any third party; * submit, transmit, or process unlawful, harmful, deceptive, abusive, infringing, or otherwise prohibited content; * attempt to gain unauthorized access to systems, accounts, models, data, or networks; * interfere with, disrupt, degrade, or circumvent the security, integrity, or availability of AI Gateway or related systems; * reverse engineer, extract, scrape, benchmark, or replicate the service except to the extent expressly permitted by applicable law; * bypass rate limits, access controls, safety protections, geographic restrictions, or usage restrictions; * use AI Gateway in a manner that could create unreasonable security, legal, reputational, or operational risk for DGrid, its providers, or other users; * resell, sublicense, or provide unauthorized third-party access to AI Gateway unless DGrid expressly permits such use in writing; or * use AI Gateway for any prohibited or restricted use case identified in DGrid documentation, policy pages, or applicable service notices. DGrid may update or supplement prohibited-use restrictions for AI Gateway from time to time. ## Customer Content As between you and DGrid, you retain any rights you may have in the prompts, inputs, data, files, or other content that you submit to AI Gateway ("Customer Content"), subject to applicable law and any rights reasonably necessary for DGrid and its service providers to operate, secure, and provide AI Gateway. You are solely responsible for Customer Content, including for: * its legality, accuracy, quality, and appropriateness; * obtaining all necessary rights, consents, notices, and permissions; and * ensuring that submission and processing of Customer Content through AI Gateway does not violate law, contract, confidentiality obligations, or third-party rights. DGrid may process Customer Content as reasonably necessary to provide, maintain, secure, support, and improve AI Gateway, subject to applicable law, technical architecture, published documentation, and any service-specific commitments DGrid may provide. DGrid does not assume responsibility for Customer Content submitted by users. ## AI Outputs AI Gateway may generate or return outputs based on Customer Content and model behavior ("Outputs"). You are responsible for evaluating Outputs for accuracy, suitability, legality, and fitness for your intended use. Outputs may be incomplete, inaccurate, biased, unavailable, delayed, or inappropriate for certain use cases and should not be relied on without appropriate review and judgment. To the extent permitted by applicable law and subject to any third-party model provider terms, as between you and DGrid, DGrid does not claim ownership of Outputs generated specifically for you through your permitted use of AI Gateway. You acknowledge that similar or identical outputs may be generated for other users or use cases. ## Third-Party Models and Services AI Gateway may rely on, interoperate with, or provide access to third-party models, infrastructure, tools, or services. DGrid does not control all third-party components and is not responsible for the acts, omissions, availability, performance, content, policies, or terms of third-party providers. Your use of certain AI Gateway features may be subject to additional third-party terms, technical limitations, model-specific restrictions, or regional availability constraints. DGrid may modify, replace, suspend, or remove access to third-party components at any time. ## Availability and Service Changes DGrid may modify, update, improve, suspend, or discontinue any part of AI Gateway at any time, with or without notice, to the extent permitted by applicable law. DGrid does not guarantee that AI Gateway, or any specific feature, model, integration, or interface, will always be available, uninterrupted, secure, or error-free. Access to AI Gateway may vary based on product plan, technical requirements, geography, compliance constraints, provider availability, maintenance needs, or other operational considerations. ## Fees and Billing Use of AI Gateway may be subject to fees, usage-based charges, credits, or other commercial arrangements, as described in applicable ordering materials, product documentation, or commercial terms provided by DGrid. Unless DGrid expressly states otherwise in writing: * fees are non-cancelable and non-refundable once incurred; * you are responsible for applicable taxes, duties, or similar governmental charges, excluding taxes based on DGrid's net income; and * DGrid may suspend or limit access where fees remain unpaid or where billing risk is reasonably identified. If no separate commercial terms apply, DGrid reserves the right to introduce or revise pricing, usage limits, or billing structures for AI Gateway upon reasonable notice. ## Suspension and Termination DGrid may suspend, restrict, or terminate your access to AI Gateway, in whole or in part, immediately or at a later time, where DGrid reasonably determines that: * you have violated these Terms or applicable policies; * your use creates security, legal, compliance, or operational risk; * access is required to be restricted by law, regulation, court order, sanctions requirement, or government request; * fees are overdue; or * continued provision of the service is no longer commercially, technically, or legally feasible. You may stop using AI Gateway at any time. Upon suspension or termination, your right to access and use AI Gateway will cease to the extent specified by DGrid. Provisions that by their nature should survive suspension or termination will survive, including provisions relating to compliance, disclaimers, limitations of liability, payment obligations, and dispute-related matters. ## Regional Availability AI Gateway may not be available in all countries, territories, or jurisdictions, and certain features, models, or capabilities may be unavailable or restricted in particular regions. Your use of AI Gateway is subject to DGrid's then-current regional availability rules and any applicable supported-country or supported-region policy published by DGrid. For additional guidance, see [Supported Countries and Regions](/ai-gateway/supported-regions). ## Disclaimers AI GATEWAY IS PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, DGRID DISCLAIMS ALL WARRANTIES, CONDITIONS, REPRESENTATIONS, AND GUARANTEES, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, ACCURACY, AVAILABILITY, SECURITY, OR RELIABILITY. WITHOUT LIMITING THE FOREGOING, DGRID DOES NOT WARRANT THAT: * AI GATEWAY WILL BE UNINTERRUPTED, ERROR-FREE, OR FREE OF HARMFUL COMPONENTS; * OUTPUTS WILL BE ACCURATE, COMPLETE, TIMELY, RELIABLE, OR FIT FOR ANY PARTICULAR PURPOSE; OR * ANY FEATURE, MODEL, OR THIRD-PARTY INTEGRATION WILL REMAIN AVAILABLE. ## Limitation of Liability TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, DGRID AND ITS AFFILIATES, LICENSORS, SERVICE PROVIDERS, AND SUPPLIERS WILL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, OR FOR ANY LOSS OF PROFITS, REVENUE, BUSINESS, GOODWILL, DATA, OR USE, ARISING OUT OF OR RELATING TO AI GATEWAY OR THESE TERMS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE TOTAL AGGREGATE LIABILITY OF DGRID FOR ALL CLAIMS ARISING OUT OF OR RELATING TO AI GATEWAY OR THESE TERMS WILL NOT EXCEED THE AMOUNT PAID OR PAYABLE BY YOU TO DGRID FOR AI GATEWAY DURING THE TWELVE (12) MONTHS PRECEDING THE EVENT GIVING RISE TO THE CLAIM, OR, IF NO FEES WERE PAID, A REASONABLE MINIMUM AMOUNT TO BE REVIEWED BY DGRID. Nothing in these Terms excludes or limits
프로젝트로 돌아가기